Commit cde21103 authored by duanjinfei's avatar duanjinfei

change resp res

parent f69c335a
...@@ -13,10 +13,10 @@ func (d *BaseController) ResponseInfo(code int, msg interface{}, result interfac ...@@ -13,10 +13,10 @@ func (d *BaseController) ResponseInfo(code int, msg interface{}, result interfac
switch code { switch code {
case 500: case 500:
logs.Error(msg, result) logs.Error(msg, result)
d.Data["json"] = result d.Data["json"] = map[string]interface{}{"code": "500", "msg": msg, "content": result}
case 200: case 200:
logs.Info(msg, result) logs.Info(msg, result)
d.Data["json"] = result d.Data["json"] = map[string]interface{}{"code": "200", "msg": msg, "content": result}
} }
d.ServeJSON() d.ServeJSON()
} }
...@@ -34,7 +34,7 @@ func (c *LLMController) GetContainerSign() { ...@@ -34,7 +34,7 @@ func (c *LLMController) GetContainerSign() {
func (c *LLMController) GetExecRes() { func (c *LLMController) GetExecRes() {
time.Sleep(time.Second * 5) time.Sleep(time.Second * 5)
c.ResponseInfo(200, "OK", "Task successfully") c.ResponseInfo(200, "OK", "https://paint4art.oss-cn-beijing.aliyuncs.com/aiimages/SN90P6aKwh.jpg")
} }
func stringToPrivateKey(privateKeyStr string) *ecdsa.PrivateKey { func stringToPrivateKey(privateKeyStr string) *ecdsa.PrivateKey {
...@@ -47,5 +47,4 @@ func stringToPrivateKey(privateKeyStr string) *ecdsa.PrivateKey { ...@@ -47,5 +47,4 @@ func stringToPrivateKey(privateKeyStr string) *ecdsa.PrivateKey {
return nil return nil
} }
return privateKey return privateKey
} }
...@@ -12,3 +12,9 @@ type TaskInfo struct { ...@@ -12,3 +12,9 @@ type TaskInfo struct {
ImageID string `json:"image_id"` ImageID string `json:"image_id"`
ImageUri string `json:"image_uri"` ImageUri string `json:"image_uri"`
} }
type ModelInfo struct {
ModelType string `json:"modelType"`
Model string `json:"model"`
Desc string `json:"desc"`
}
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