common.api 1.4 KB
    // 通用接口
    @server(
        prefix: v1
        group: common
    )
    service Core {
        @doc "日志查询"
        @handler commonGetLog
        get /log/:module

        @doc "文件服务"
        @handler commonGetFile
        get /file/:module
    }

    // 通用接口
    @server(
        prefix: v1
        middleware: LogRequest
        group: common
    )
    service Core {
        @doc "短信验证码"
        @handler commonSmsCode
        post /common/sms/code (CommonSmsCodeRequest) returns (CommonSmsCodeResposne)

        @doc "短信验证码"
        @handler commonTextToSpeech
        post /common/tts (TextToSpeechRequest) returns (TextToSpeechResponse)

        @doc "微信二维码"
        @handler miniQrcodeInvite
        post /mini/qrcode (MiniQrCodeRequest)

        @doc "清理缓存"
        @handler commonGetClearCache
        get /clear
    }

    // 短信验证码
    type(
        CommonSmsCodeRequest{
            Phone string `json:"phone"`
        }
        CommonSmsCodeResposne{

        }
    )

    type(
        MiniQrCodeRequest{
            Page string `json:"page"`    // 微信页面入口
            Scene string `json:"scene"`   // 参数
        }
    )

    type(
        TextToSpeechRequest{
            Text string `json:"text"` // 文本信息
        }
        TextToSpeechResponse{
            AudioUrl string `json:"audioUrl"` // 音频文件地址
        }
    )