60 lines
1.4 KiB
Go
60 lines
1.4 KiB
Go
|
package api
|
||
|
|
||
|
import (
|
||
|
"github.com/gin-gonic/gin"
|
||
|
"github.com/goWxHook/goWxHook/core"
|
||
|
"github.com/goWxHook/goWxHook/utils"
|
||
|
)
|
||
|
|
||
|
// getA8Key
|
||
|
//
|
||
|
// @Summary 获取A8Key
|
||
|
// @Description 获取A8Key接口
|
||
|
// @Tags 其他
|
||
|
// @Accept json
|
||
|
// @Produce json
|
||
|
// @Param body body core.GetA8KeyRequest true "A8Key请求"
|
||
|
// @Response 200 {object} CommonStringResponse{Data=core.GetA8KeyResponseData} "{\"code\":0, ....}
|
||
|
// @Router /api/v1/other/get_a8_key [post]
|
||
|
func (w *WebApi) getA8Key(c *gin.Context) {
|
||
|
var form core.GetA8KeyRequest
|
||
|
err := c.ShouldBindJSON(&form)
|
||
|
if err != nil {
|
||
|
utils.ResponseError(c, err.Error(), nil)
|
||
|
return
|
||
|
}
|
||
|
info, err := w.WxApi.GetA8Key(form)
|
||
|
if err != nil {
|
||
|
utils.ResponseError(c, err.Error(), nil)
|
||
|
return
|
||
|
}
|
||
|
utils.ResponseOK(c, "success", info)
|
||
|
return
|
||
|
}
|
||
|
|
||
|
// decryptImg
|
||
|
//
|
||
|
// @Summary 解密图片
|
||
|
// @Description 解密图片接口
|
||
|
// @Tags 其他
|
||
|
// @Accept json
|
||
|
// @Produce json
|
||
|
// @Param body body core.DecryptImgRequest true "解密图片请求"
|
||
|
// @Response 200 {object} CommonStringResponse "{\"code\":0, ....}
|
||
|
// @Router /api/v1/other/decrypt_img [post]
|
||
|
func (w *WebApi) decryptImg(c *gin.Context) {
|
||
|
var form core.DecryptImgRequest
|
||
|
err := c.ShouldBindJSON(&form)
|
||
|
if err != nil {
|
||
|
utils.ResponseError(c, err.Error(), nil)
|
||
|
return
|
||
|
}
|
||
|
err = w.WxApi.DecryptImg(form)
|
||
|
if err != nil {
|
||
|
utils.ResponseError(c, err.Error(), nil)
|
||
|
return
|
||
|
}
|
||
|
utils.ResponseOK(c, "success", nil)
|
||
|
return
|
||
|
}
|