黄梓健
5 years ago
18 changed files with 256 additions and 140 deletions
-
15controllers/base.go
-
178controllers/client/good.go
-
22controllers/client/invite_envelope.go
-
14controllers/client/live.go
-
10controllers/client/wx.go
-
7log/hdzj.log
-
6models/customer_goods.go
-
28models/customer_order.go
-
36models/customer_order_sub.go
-
1models/init_models.go
-
3models/live_config.go
-
8models/test/config.json
-
11models/test/private.json
-
32models/test/sensitive_test.go
-
BINmodels/test/敏感词汇.xlsx
-
2models/user_order.go
-
18services/pay/order.go
-
5utils/code/code.go
@ -0,0 +1,36 @@ |
|||
package models |
|||
|
|||
import ( |
|||
"fmt" |
|||
"github.com/ouxuanserver/osmanthuswine/src/core" |
|||
"time" |
|||
) |
|||
|
|||
const CustomerOrderSubTN = TableNamePrefix + "customer_order_sub" |
|||
|
|||
type CustomerOrderSub struct { |
|||
Id int64 `json:"id" xorm:"not null pk autoincr comment('主键') INT(11)"` |
|||
IsDelete bool `json:"is_delete" xorm:"not null default 0 comment('软删除') TINYINT(1)"` |
|||
CreatedAt time.Time `json:"created_at" xorm:"not null created comment('创建时间') DATETIME"` |
|||
UpdatedAt time.Time `json:"updated_at" xorm:"not null updated comment('更新时间') DATETIME"` |
|||
|
|||
OutTradeNo string `json:"out_trade_no" xorm:"not null default 0 comment('订单号') VARCHAR(128)"` |
|||
GoodsId int64 `json:"goods_id" xorm:"not null default 0 comment('商品id') INT(11)"` |
|||
GoodsNum int `json:"goods_num" xorm:"not null default 0 comment('商品数量') INT(11)"` |
|||
GoodName string `json:"good_name" xorm:"not null default '' comment('商品名字') VARCHAR(128)"` |
|||
GoodPrice float64 `json:"good_price" xorm:"not null default 0.00 comment('商品价格') DECIMAL(18)"` |
|||
} |
|||
|
|||
func (t *CustomerOrderSub) TableName() string { |
|||
return CustomerOrderSubTN |
|||
} |
|||
|
|||
func (t *CustomerOrderSub) Alias(n string) string { |
|||
return fmt.Sprintf("%s as %s", t.TableName(), n) |
|||
} |
|||
|
|||
func GetCustomerOrderSubByOutTradeNos(outTradeNos []string) (subs []*CustomerOrderSub, err error) { |
|||
err = core.GetXormAuto().Where("is_delete=0").In("out_trade_no", outTradeNos). |
|||
Asc("created_at").Find(&subs) |
|||
return |
|||
} |
@ -1,8 +0,0 @@ |
|||
{ |
|||
"port": "20181", |
|||
"host": "0.0.0.0", |
|||
"cross_domain": "*", |
|||
"post_max_memory": 1024000, |
|||
"api_router": "/PcClient/*", |
|||
"update_path": "example_update" |
|||
} |
@ -1,11 +0,0 @@ |
|||
{ |
|||
"db": { |
|||
"host": "gz-cdb-onvbcfqn.sql.tencentcdb.com", |
|||
"port": "61232", |
|||
"user": "root", |
|||
"password": "Pox2210XXa@", |
|||
"name": "hudongzhuanjia", |
|||
"prefix": "ox_", |
|||
"max_open_conn": 500 |
|||
} |
|||
} |
@ -1,32 +0,0 @@ |
|||
package test |
|||
|
|||
import ( |
|||
"github.com/360EntSecGroup-Skylar/excelize/v2" |
|||
"hudongzhuanjia/models" |
|||
"testing" |
|||
"time" |
|||
) |
|||
|
|||
func TestAddSensitive(t *testing.T) { |
|||
f, err := excelize.OpenFile("敏感词汇.xlsx") |
|||
if err != nil { |
|||
t.Fatal(err) |
|||
} |
|||
|
|||
rows, err := f.GetRows("big_audit_keyword") |
|||
for i, row := range rows { |
|||
if i == 0 { |
|||
continue |
|||
} |
|||
|
|||
if err := models.Save(nil, &models.Sensitive{ |
|||
Keyword: row[1], |
|||
Category: row[2], |
|||
Host: row[3], |
|||
CreateAt: time.Now(), |
|||
UpdateAt: time.Now(), |
|||
}, nil); err != nil { |
|||
t.Fatal(err) |
|||
} |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue