You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
793 B
36 lines
793 B
package copartner
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
"recook/internal/v2/lib/back"
|
|
"recook/internal/v2/logic/wxapp/copartner"
|
|
"recook/tools"
|
|
)
|
|
|
|
type License struct {
|
|
}
|
|
type argsCompanyLicense struct {
|
|
Url string // 营业执照 地址
|
|
}
|
|
type argsCompanyLicenseResp struct {
|
|
Taxpayer string `json:"taxpayer"`
|
|
CorporationName string `json:"corporation_name"`
|
|
}
|
|
|
|
// License @Title 识别营业执照
|
|
func (l License) License(c *gin.Context) {
|
|
var args argsCompanyLicense
|
|
if err := tools.Params(&args, c); err != nil {
|
|
back.Fail(c, err.Error())
|
|
return
|
|
}
|
|
if name, num, err := copartner.LicenseLogic.License(args.Url); err != nil {
|
|
back.Fail(c, err.Error())
|
|
} else {
|
|
back.Suc(c, "ok", argsCompanyLicenseResp{
|
|
Taxpayer: num,
|
|
CorporationName: name,
|
|
})
|
|
}
|
|
}
|