Browse Source

update

master
dengbiao 2 months ago
parent
commit
7cc484d4e0
7 changed files with 1166 additions and 3300 deletions
  1. +3
    -3
      app/hdl/hdl_login.go
  2. +7
    -0
      app/md/md_api_response.go
  3. +17
    -32
      app/svc/svc_master.go
  4. +419
    -1244
      docs/docs.go
  5. +411
    -1198
      docs/swagger.json
  6. +307
    -821
      docs/swagger.yaml
  7. +2
    -2
      go.mod

+ 3
- 3
app/hdl/hdl_login.go View File

@@ -18,9 +18,9 @@ import (
// @Description 登入
// @Accept json
// @Produce json
// @Param req body md2.LoginReq true "用户名密码"
// @Success 200 {object} md2.LoginResponse "token"
// @Failure 400 {object} md2.Response "具体错误"
// @Param req body md.LoginReq true "用户名密码"
// @Success 200 {object} md.LoginResponse "token"
// @Failure 400 {object} md.Response "具体错误"
// @Router /admin/login [post]
func Login(c *gin.Context) {
var req md.LoginReq


+ 7
- 0
app/md/md_api_response.go View File

@@ -0,0 +1,7 @@
package md

type Response struct {
Code string `json:"code" example:"响应码"`
Data interface{} `json:"data" ` //内容
Msg string `json:"msg" example:"具体错误原因"`
}

+ 17
- 32
app/svc/svc_master.go View File

@@ -1,6 +1,10 @@
package svc

import (
"applet/app/e"
"applet/app/utils"
db "code.fnuoos.com/zhimeng/model.git/src"
"code.fnuoos.com/zhimeng/model.git/src/super/implement"
"fmt"
"github.com/gin-gonic/gin"
"strconv"
@@ -15,38 +19,19 @@ func GetMasterId(c *gin.Context) (masterId string) {
masterId = c.GetString("master_id")
if masterId == "" {
//TODO::通过域名查找masterId
//host := c.Request.Host

//fmt.Println("not found master_id found MasterId start")
//masterId = c.GetHeader("MasterId")
//if masterId == "" && c.GetHeader("Platform") == md.PLATFORM_WAP { // H5 要根据域名去获取mid
// hostList := strings.Split(c.Request.Host, ".")
// if isNumeric(hostList[0]) {
// masterId = hostList[0]
// } else if isNumeric(hostList[1]) {
// masterId = hostList[1]
// } else {
// // 自定义域名
// masterId = svc.GetWebSiteDomainMasterId(baseDb, md.PLATFORM_WAP, c.Request.Host)
// }
//}
//if masterId == "" && c.GetHeader("Platform") == md.PLATFORM_PC { // H5 要根据域名去获取mid
// hostList := strings.Split(c.Request.Host, ".")
// if isNumeric(hostList[0]) {
// masterId = hostList[0]
// } else if isNumeric(hostList[1]) {
// masterId = hostList[1]
// } else {
// // 自定义域名
// masterId = svc.GetWebSiteDomainMasterId(baseDb, md.PLATFORM_PC, c.Request.Host)
// }
//}
//if masterId == "" && c.GetHeader("Platform") == "" { // 无平台访问
// hostList := strings.Split(c.Request.Host, ".")
// if isNumeric(hostList[0]) {
// masterId = hostList[0]
// }
//}
host := c.Request.Host
agentAppDomainDb := implement.NewAgentAppDomainDb(db.Db)
agentAppDomain, err := agentAppDomainDb.GetAgentAppDomainByHost(host)
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err)
return
}
if agentAppDomain == nil {
e.OutErr(c, e.ERR_NOT_FAN, "域名不存在")
return
}
masterId = utils.IntToStr(agentAppDomain.Uuid)
c.Set("master_id", masterId)
}
fmt.Println("master_id:::::::", masterId)
return


+ 419
- 1244
docs/docs.go
File diff suppressed because it is too large
View File


+ 411
- 1198
docs/swagger.json
File diff suppressed because it is too large
View File


+ 307
- 821
docs/swagger.yaml
File diff suppressed because it is too large
View File


+ 2
- 2
go.mod View File

@@ -2,10 +2,10 @@ module applet

go 1.18

//replace code.fnuoos.com/zhimeng/model.git => E:/company/ad/models
replace code.fnuoos.com/zhimeng/model.git => E:/company/ad/models

require (
code.fnuoos.com/zhimeng/model.git v0.0.3-0.20240816151818-a491f294f782
code.fnuoos.com/zhimeng/model.git v0.0.3-0.20240817100708-dde162209cee
github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751
github.com/boombuler/barcode v1.0.1


Loading…
Cancel
Save