diff --git a/internal/biz/bo/order_bo.go b/internal/biz/bo/order_bo.go index 30b0a33..4d1371f 100644 --- a/internal/biz/bo/order_bo.go +++ b/internal/biz/bo/order_bo.go @@ -23,6 +23,7 @@ type OrderBo struct { Channel vo.Channel Attach string Remark string + LastUseTime *time.Time CreateTime *time.Time UpdateTime *time.Time } diff --git a/internal/data/model/order.gen.go b/internal/data/model/order.gen.go index 2dfd1be..3608ccf 100644 --- a/internal/data/model/order.gen.go +++ b/internal/data/model/order.gen.go @@ -28,6 +28,7 @@ type Order struct { Channel uint8 `gorm:"column:channel;not null;comment:1:微信 2:支付宝" json:"channel"` // 1:微信 2:支付宝 Remark string `gorm:"column:remark;not null;comment:remark" json:"remark"` Attach string `gorm:"column:attach;not null;comment:attach" json:"attach"` + LastUseTime *time.Time `gorm:"column:last_use_time" json:"last_use_time"` CreateTime *time.Time `gorm:"column:create_time" json:"create_time"` UpdateTime *time.Time `gorm:"column:update_time" json:"update_time"` } diff --git a/internal/data/repoimpl/order.go b/internal/data/repoimpl/order.go index 81565b6..0dcb871 100644 --- a/internal/data/repoimpl/order.go +++ b/internal/data/repoimpl/order.go @@ -215,8 +215,9 @@ func (p *OrderRepoImpl) Used(ctx context.Context, id uint64) error { ID: id, }). Updates(model.Order{ - Status: vo.OrderStatusUse.GetValue(), - UpdateTime: &now, + Status: vo.OrderStatusUse.GetValue(), + LastUseTime: &now, + UpdateTime: &now, }) if res.Error != nil { diff --git a/internal/pkg/cmb/sm2_test.go b/internal/pkg/cmb/sm2_test.go index 73ca00e..7be6f91 100644 --- a/internal/pkg/cmb/sm2_test.go +++ b/internal/pkg/cmb/sm2_test.go @@ -21,14 +21,13 @@ func TestEncrypt(t *testing.T) { pukKey := "04a702106cf530dc981e44cd515b394747cfd6bb059247696b188b25281ea4278fe7c6e34a83680110eec71becd31f5db14abc671e5d8e67ce7ca3c6b3adc86674" content := `{"name":"zhangxx","phoneNo":"137xxxxxxxx"}` xx, err := Encrypt(pukKey, content) - //BPGf+1joX5wdo47DfCA1HN9QK7qC6YvUoPTAyW6g5fJXr+xRtAsyGDNwV5gGab11Cescueh/pyz/Qr/t2ejx33E+A1AkEeRoqUSFurvtMp6h8xhJ5afagNGLZUt1Yus6tlE4dtaOfv+bB9PXjYWpQUJjBXgaVBWa0VFyg7ysudoIjKDP3ljIxY2sFhnE|kYYOo7VmcS1AvBbAR1oHOdC2SzuQka1097yzVE6KP3yKRrbjd05BrcFETsU65sww t.Log(xx, err) } func TestDecrypt(t *testing.T) { priKey := "9450c673cf801164435b9c164ac1404e87997245bc6f323fde22015875a03f6e" - content := "BPGf+1joX5wdo47DfCA1HN9QK7qC6YvUoPTAyW6g5fJXr+xRtAsyGDNwV5gGab11Cescueh/pyz/Qr/t2ejx33E+A1AkEeRoqUSFurvtMp6h8xhJ5afagNGLZUt1Yus6tlE4dtaOfv+bB9PXjYWpQUJjBXgaVBWa0VFyg7ysudoIjKDP3ljIxY2sFhnE|kYYOo7VmcS1AvBbAR1oHOdC2SzuQka1097yzVE6KP3yKRrbjd05BrcFETsU65sww" + content := "BHhdJbBP8hybQ57niOICuPiaNTGYKgLF3Ntf1ShdpHDjS6s3UJOCpSxEj0nWCVGlJMcTBJIBZ0pvPD4/oWKxgmp69MhpR3VWJeDcHhJHALdvzl2CR2GTXB7lgy1eUEBH/HlYxCK2P3kcV2ENKkazQRpT2Gk5WJ0rCV8iSaEqovmjRsTV3V4eLLrcuzK+|NZQ2Ae4McLlpSjBhYWQFmc9g0h/DQHcykGwIproe0AA0HayMun04aalcZmzh4Qp5p1SBZNBfwqtETyEjHYlWTj7/ht+kWsWRkuVx1uipZVIYPkOw5thsjoCdK+q1S76EssDCXOTVf/XAoSgqV+6/a1dGwkQgzXVGkGdAUoOdN0Rry8g8JnTBQZyiQY/fjDTiieJiS9MUmm6JiE/wZGG+LliUKHVsF8ZdrIEyrkSgAWw=" xx, err := Decrypt(priKey, content) if err != nil { @@ -40,7 +39,7 @@ func TestDecrypt(t *testing.T) { func TestEncryptDecrypt(t *testing.T) { priKey := "8d39ff3d2559258c163f4510f082727f51531e1953ab203d5ab1ea4a6d94fd73" - pukKey := "04D827A7DBAAA358CE45B8C7794A7F54819F5C175005A702370E47F135EF6F5F9732758B1474F218419FE9E87F90C28C3B05F08254C651DB27DF35FAE67B77B2E4" + pukKey := "04d827a7dbaaa358ce45b8c7794a7f54819f5c175005a702370e47f135ef6f5f9732758b1474f218419fe9e87f90c28c3b05f08254c651db27df35fae67b77b2e4" content := `{"name":"zhangxx","phoneNo":"137xxxxxxxx"}` @@ -56,6 +55,7 @@ func TestEncryptDecrypt(t *testing.T) { t.Log(err) return } + t.Log(aa) }