| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- 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)
- }
- }
|