Commit 0f82b0ef authored by brent's avatar brent

add whitelist

parent 6f2d3e60
......@@ -2,9 +2,11 @@ package controllers
import (
"ai_developer_admin/libs/mysql"
"ai_developer_admin/libs/odysseus"
"ai_developer_admin/models"
"encoding/json"
"github.com/beego/beego/v2/core/logs"
"github.com/odysseus/cache/model"
"net/http"
"time"
)
......@@ -152,6 +154,17 @@ func (server *WhitelistController) Update() {
return
}
whitelist := model.Whitelist{
ID: int64(request.Id),
Character: request.ProfitAddress,
NodeNum: int64(request.NodeNum),
CreatedTime: request.CreatedTime,
UpdatedTime: request.UpdatedTime,
Deleted: int64(request.Deleted),
}
odysseus.SetWhiteListToRedis(&whitelist)
server.respond(http.StatusOK, "更新成功")
}
......@@ -199,5 +212,16 @@ func (server *WhitelistController) Delete() {
return
}
whitelist := model.Whitelist{
ID: int64(request.Id),
Character: request.ProfitAddress,
NodeNum: int64(request.NodeNum),
CreatedTime: request.CreatedTime,
UpdatedTime: request.UpdatedTime,
Deleted: int64(request.Deleted),
}
odysseus.DeleteWhiteList(&whitelist)
server.respond(http.StatusOK, "删除成功")
}
{"/Users/brent/Documents/wubanWork/ai_developer_admin/controllers":1709611871713483652}
\ No newline at end of file
{"/Users/brent/Documents/wubanWork/ai_developer_admin/controllers":1709619166614368556}
\ No newline at end of file
......@@ -65,3 +65,11 @@ func GetTaskType(id int64) (*model.TaskType, error) {
func PublichTaskUpdate(path string) error {
return syncinfo.PublichTaskUpdate(path)
}
func SetWhiteListToRedis(wh *model.Whitelist) error {
return syncinfo.SetWhiteListToRedis(wh)
}
func DeleteWhiteList(wh *model.Whitelist) error {
return syncinfo.DeleteWhiteList(wh)
}
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