Commit 8a4e2544 authored by vicotor's avatar vicotor

add publickey

parent e047b6f7
...@@ -15,15 +15,15 @@ func newCache() *CacheData { ...@@ -15,15 +15,15 @@ func newCache() *CacheData {
return _cache return _cache
} }
_cache = NewCacheData(context.Background(), RedisConnParam{ _cache = NewCacheData(context.Background(), RedisConnParam{
Addr: "192.168.1.10:6379", Addr: "43.198.252.255:6379",
Password: "", Password: "iH0g2CqzjI6SfercGwsT",
DbIndex: 0, DbIndex: 0,
}, model.DbConfig{ }, model.DbConfig{
Host: "192.168.1.211", Host: "43.198.252.255",
Port: 3306, Port: 3306,
DbName: "liuxuzhong", DbName: "ai",
Passwd: "12345678", Passwd: "RFnnKHRar5xk7TEF",
User: "root", User: "ai",
}) })
return _cache return _cache
} }
...@@ -31,8 +31,8 @@ func newCache() *CacheData { ...@@ -31,8 +31,8 @@ func newCache() *CacheData {
func TestCacheData_Query(t *testing.T) { func TestCacheData_Query(t *testing.T) {
cache := newCache() cache := newCache()
testPath := "/start/docker" testPath := "/txt2Img/demianhjw/aigic"
testUid := int64(19) testUid := int64(23)
task, err := cache.Query(testPath, testUid) task, err := cache.Query(testPath, testUid)
if err != nil { if err != nil {
......
...@@ -291,7 +291,7 @@ func (c *CacheData) costForFee(uid int64, fee int64) error { ...@@ -291,7 +291,7 @@ func (c *CacheData) costForFee(uid int64, fee int64) error {
} }
if fee < 0 { if fee < 0 {
txp := c.rdb.TxPipeline() txp := c.rdb.TxPipeline()
txp.DecrBy(c.ctx, chargeKey, fee) txp.DecrBy(c.ctx, chargeKey, -fee)
_, err := txp.Exec(c.ctx) _, err := txp.Exec(c.ctx)
return err return err
} }
......
...@@ -10,6 +10,7 @@ type TaskType struct { ...@@ -10,6 +10,7 @@ type TaskType struct {
Desc string `orm:"column(desc)" db:"desc" json:"desc" form:"desc"` // 任务类型描述 Desc string `orm:"column(desc)" db:"desc" json:"desc" form:"desc"` // 任务类型描述
Price int64 `orm:"column(price)" db:"price" json:"price" form:"price"` // 该任务类型的费用 Price int64 `orm:"column(price)" db:"price" json:"price" form:"price"` // 该任务类型的费用
Complexity int64 `orm:"column(complexity)" db:"complexity" json:"complexity" form:"complexity"` Complexity int64 `orm:"column(complexity)" db:"complexity" json:"complexity" form:"complexity"`
PublicKey string `orm:"column(public_key)" db:"public_key" json:"public_key" form:"public_key"`
HardwareRequire string `orm:"column(hardware_require)" db:"hardware_require" json:"hardware_require" form:"hardware_require"` HardwareRequire string `orm:"column(hardware_require)" db:"hardware_require" json:"hardware_require" form:"hardware_require"`
ImageId string `orm:"column(image_id)" db:"image_id" json:"image_id" form:"image_id"` ImageId string `orm:"column(image_id)" db:"image_id" json:"image_id" form:"image_id"`
ImageUrl string `orm:"column(image_url)" db:"image_url" json:"image_url" form:"image_url"` ImageUrl string `orm:"column(image_url)" db:"image_url" json:"image_url" form:"image_url"`
......
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