import { Controller } from 'egg' ; import { getRepoFullName } from '../basic/Utils' ; export default class Docs extends Controller { public async communitySvgImage ( ) { const { installationName , owner , repo } = this . ctx . params ; if ( ! installationName || ! owner || ! repo ) { this . ctx . body = 'PARAM ERROR' ; return ; } const client = await this . app . installation . getHostingClientByInstallationName ( installationName , getRepoFullName ( owner , repo ) ) ; if ( ! client ) { this . ctx . body = 'Client not found' ; return ; } this . ctx . set ( 'Content-Type' , 'image/svg+xml' ) ; const svg = client . communitySvgImage ( ) ; this . ctx . body = svg ; } }