Commit ef29a55d by zhengqiuyun86

初始化基础信息和后台管理的结构

parent 2b599a43
{"level":"WARN","ts":"2021-10-07 16:08:55.565","msg":"","HostName":"DESKTOP-2789F62","Status":404,"SpendNanoS":0,"Ip":"127.0.0.1","Method":"GET","Path":"/swagger/","DataSize":18,"Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36"}
{"level":"WARN","ts":"2021-10-07 16:09:16.983","msg":"","HostName":"DESKTOP-2789F62","Status":404,"SpendNanoS":0,"Ip":"127.0.0.1","Method":"GET","Path":"/favicon.ico","DataSize":0,"Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36"}
...@@ -14,4 +14,5 @@ type UWeCustomer struct { ...@@ -14,4 +14,5 @@ type UWeCustomer struct {
CreateAt time.Time `json:"createAt"` CreateAt time.Time `json:"createAt"`
LoginAt time.Time `json:"loginAt"` LoginAt time.Time `json:"loginAt"`
TestRole bool `json:"testRole"` //是否是有测试权限 TestRole bool `json:"testRole"` //是否是有测试权限
updaterId uint32
} }
...@@ -2,7 +2,7 @@ package web ...@@ -2,7 +2,7 @@ package web
import ( import (
"dc_golang_server_1/wechat/model" "dc_golang_server_1/wechat/model"
"dc_golang_server_1/wechat/service" wechatService "dc_golang_server_1/wechat/service"
"dc_golang_server_1/wechat/web/response" "dc_golang_server_1/wechat/web/response"
responseState "dc_golang_server_1/wechat/web/response/state" responseState "dc_golang_server_1/wechat/web/response/state"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
...@@ -25,7 +25,7 @@ type TestResponse struct { ...@@ -25,7 +25,7 @@ type TestResponse struct {
func test(c *gin.Context) { func test(c *gin.Context) {
unionid := c.Query("unionid") unionid := c.Query("unionid")
var customer model.UWeCustomer var customer model.UWeCustomer
customer = service.FindUWeCustomerByUnionid(unionid) customer = wechatService.FindUWeCustomerByUnionid(unionid)
if customer.Id == 0 { if customer.Id == 0 {
c.JSON(http.StatusOK, response.ServerErrorResponse{Code: responseState.StateBusinessError, Msg: "用户不存在"}) c.JSON(http.StatusOK, response.ServerErrorResponse{Code: responseState.StateBusinessError, Msg: "用户不存在"})
} else { } else {
...@@ -42,11 +42,10 @@ func test(c *gin.Context) { ...@@ -42,11 +42,10 @@ func test(c *gin.Context) {
// @Router /v1/login/{code} [POST] // @Router /v1/login/{code} [POST]
func weLogin(c *gin.Context) { func weLogin(c *gin.Context) {
code := c.Param("code") code := c.Param("code")
responseData, err := service.LoginFromWechatApplet(code) responseData, err := wechatService.LoginFromWechatApplet(code)
if err != (response.ServerErrorResponse{}) { if err != (response.ServerErrorResponse{}) {
c.JSON(http.StatusOK, err) c.JSON(http.StatusOK, err)
} else { } else {
c.JSON(http.StatusOK, responseData) c.JSON(http.StatusOK, responseData)
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment