123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- package NatsServer
- import (
- "ERP_storage/Nats"
- "ERP_storage/conf"
- "ERP_storage/logs"
- natslibs "gogs.baozhida.cn/zoie/ERP_libs/Nats"
- powerlibs "gogs.baozhida.cn/zoie/ERP_libs/Power"
- userlibs "gogs.baozhida.cn/zoie/ERP_libs/User"
- "gogs.baozhida.cn/zoie/ERP_libs/lib"
- )
- // 验证TOKEY
- func Verification(GetCookie string, GetString string) (user userlibs.User, err error) {
- nats := natslibs.NewNats(Nats.Nats, conf.NatsSubj_Prefix)
- user, err = nats.Verification(GetCookie, GetString)
- if err != nil {
- logs.Error(lib.FuncName(), err)
- return user, err
- }
- return user, nil
- }
- func Read_User_List_All() (user []userlibs.User, err error) {
- nats := natslibs.NewNats(Nats.Nats, conf.NatsSubj_Prefix)
- user, err = nats.Read_User_List_All()
- if err != nil {
- logs.Error(lib.FuncName(), err)
- return user, err
- }
- return user, nil
- }
- func Read_User_List_T_uuid(T_name string, T_uuid_list []string, page, page_z int) (user []userlibs.User, cnt int64, err error) {
- nats := natslibs.NewNats(Nats.Nats, conf.NatsSubj_Prefix)
- user, cnt, err = nats.Read_User_List_T_uuid(T_name, T_uuid_list, page, page_z)
- if err != nil {
- logs.Error(lib.FuncName(), err)
- return user, cnt, err
- }
- return user, cnt, nil
- }
- func Read_Power_List_All() (power []powerlibs.Power_R, err error) {
- nats := natslibs.NewNats(Nats.Nats, conf.NatsSubj_Prefix)
- power, err = nats.Read_Power_List_All()
- if err != nil {
- logs.Error(lib.FuncName(), err)
- return power, err
- }
- return power, nil
- }
- // 添加系统日志
- func AddSysLogs(T_class, T_title string, T_txt interface{}) {
- nats := natslibs.NewNats(Nats.Nats, conf.NatsSubj_Prefix)
- nats.AddSysLogs(T_class, T_title, T_txt)
- }
- // 添加用户日志
- func AddUserLogs(T_uuid, T_class, T_title string, T_txt interface{}) {
- nats := natslibs.NewNats(Nats.Nats, conf.NatsSubj_Prefix)
- nats.AddUserLogs(T_uuid, T_class, T_title, T_txt)
- }
- // 添加用户日志
- func AddNews(T_uuid, T_title, T_Url string) {
- nats := natslibs.NewNats(Nats.Nats, conf.NatsSubj_Prefix)
- nats.AddNews(T_uuid, T_title, T_Url)
- }
|