package test import ( "git.rtzhtech.cn/iss/public-lib/dto" "git.rtzhtech.cn/iss/public-lib/logic" "git.rtzhtech.cn/iss/public-lib/model" "testing" ) func TestSaveAppInfo(t *testing.T) { md := logic.NewAppInfoLogic() req := new(model.SysApp) req.Appname = "测试app" req.Version = "v1.0" req.Appid = 1 req.Path = "/home/work/xxxx" err := md.SaveAppInfo(req) if err != nil { t.Error(err) } } func TestSaveAppInfoMap(t *testing.T) { md := logic.NewAppInfoLogic() req := map[string]any{ "appid": 2, "appname": "测试app2", "path": "/home/work/yyy", "version": "v1.0", } err := md.SaveAppInfoMap(req) if err != nil { t.Error(err) } } func TestDelAppInfo(t *testing.T) { md := logic.NewAppInfoLogic() err := md.DelAppInfo(2) if err != nil { t.Error(err) } } func TestGetAppInfo(t *testing.T) { md := logic.NewAppInfoLogic() req := new(dto.GetAppInfoRequest) req.AppName = "测试" req.Page = 1 req.Limit = 22 list, err := md.GetAppInfo(req) if err != nil { t.Error(err) } for _, val := range list.List { t.Log(val) } }