作者 yangfu

fix orm models

@@ -2,7 +2,6 @@ package main @@ -2,7 +2,6 @@ package main
2 2
3 import ( 3 import (
4 "github.com/astaxie/beego" 4 "github.com/astaxie/beego"
5 - "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/application/event"  
6 "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/constant" 5 "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/constant"
7 _ "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/constant" 6 _ "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/constant"
8 _ "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/pg" 7 _ "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/pg"
@@ -21,7 +20,7 @@ func main() { @@ -21,7 +20,7 @@ func main() {
21 //ginsvr.Run() 20 //ginsvr.Run()
22 21
23 //注册事件 22 //注册事件
24 - event.InitEventCenter() 23 + //event.InitEventCenter()
25 24
26 beego.Run() 25 beego.Run()
27 } 26 }
@@ -59,6 +59,10 @@ type OrderBase struct { @@ -59,6 +59,10 @@ type OrderBase struct {
59 BonusStatus int8 59 BonusStatus int8
60 //货物列表 60 //货物列表
61 OrderGood []*OrderGood 61 OrderGood []*OrderGood
  62 + // 数据来源
  63 + DataFrom *OrderDataFrom
  64 + // 备注
  65 + Remark string
62 } 66 }
63 67
64 func (m *OrderBase) Identify() interface{} { 68 func (m *OrderBase) Identify() interface{} {
  1 +package domain
  2 +
  3 +const (
  4 + OrderDataFromBestShop string = "bestshop"
  5 +)
  6 +
  7 +//OrderDataFrom 订单数据来源
  8 +type OrderDataFrom struct {
  9 + Platform string `json:"platform"` //订单数据来源平台
  10 + DataId int64 `json:"dataId"` //订单数据id标识
  11 +}
@@ -36,6 +36,10 @@ type OrderGood struct { @@ -36,6 +36,10 @@ type OrderGood struct {
36 BonusStatus int 36 BonusStatus int
37 //备注信息 37 //备注信息
38 Remark string 38 Remark string
  39 + // 数据来源
  40 + DataFrom *OrderDataFrom
  41 + // 备注原因
  42 + RemarkReason string
39 } 43 }
40 44
41 func (g *OrderGood) Status() GoodStatus { 45 func (g *OrderGood) Status() GoodStatus {
@@ -60,4 +60,8 @@ type OrderBase struct { @@ -60,4 +60,8 @@ type OrderBase struct {
60 BonusStatus int8 60 BonusStatus int8
61 //货物列表 61 //货物列表
62 OrderGood []*OrderGood `pg:"fk:order_id"` 62 OrderGood []*OrderGood `pg:"fk:order_id"`
  63 + // 数据来源
  64 + DataFrom *domain.OrderDataFrom
  65 + // 备注
  66 + Remark string
63 } 67 }
1 package models 1 package models
2 2
  3 +import "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/domain"
  4 +
3 //OrderGood 订单中的货品 5 //OrderGood 订单中的货品
4 type OrderGood struct { 6 type OrderGood struct {
5 tableName struct{} `pg:"order_good"` 7 tableName struct{} `pg:"order_good"`
@@ -37,4 +39,8 @@ type OrderGood struct { @@ -37,4 +39,8 @@ type OrderGood struct {
37 BonusStatus int 39 BonusStatus int
38 //备注信息 40 //备注信息
39 Remark string 41 Remark string
  42 + // 数据来源
  43 + DataFrom *domain.OrderDataFrom
  44 + // 备注原因
  45 + RemarkReason string
40 } 46 }
@@ -2,10 +2,8 @@ package middleware @@ -2,10 +2,8 @@ package middleware
2 2
3 import ( 3 import (
4 "github.com/astaxie/beego/context" 4 "github.com/astaxie/beego/context"
5 - "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/application/userAuth"  
6 "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/utils" 5 "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/utils"
7 "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/protocol" 6 "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/protocol"
8 - "strconv"  
9 "strings" 7 "strings"
10 ) 8 )
11 9
@@ -40,15 +38,15 @@ func CheckJWTToken(ctx *context.Context) { @@ -40,15 +38,15 @@ func CheckJWTToken(ctx *context.Context) {
40 ctx.Input.SetData("UserId", u.UserId) 38 ctx.Input.SetData("UserId", u.UserId)
41 39
42 // valid token 40 // valid token
43 - userPhone, _ := strconv.Atoi(u.Phone)  
44 - tokenAuth := userAuth.NewRedisUserAuth(userAuth.WithUserId(int64(userPhone)))  
45 - err := tokenAuth.Check(  
46 - userAuth.NewOptions(userAuth.WithAccessToken(token)),  
47 - )  
48 - if err != nil {  
49 - msg = protocol.NewMesage(4141)  
50 - return  
51 - } 41 + //userPhone, _ := strconv.Atoi(u.Phone)
  42 + //tokenAuth := userAuth.NewRedisUserAuth(userAuth.WithUserId(int64(userPhone)))
  43 + //err := tokenAuth.Check(
  44 + // userAuth.NewOptions(userAuth.WithAccessToken(token)),
  45 + //)
  46 + //if err != nil {
  47 + // msg = protocol.NewMesage(4141)
  48 + // return
  49 + //}
52 } 50 }
53 return 51 return
54 } 52 }