commits
This commit is contained in:
+19
-19
@@ -1,19 +1,19 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// AdminRole 平台角色表 yz_system_admin_role
|
||||
type AdminRole struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Cid uint8 `orm:"column(cid);default(1)" json:"cid"` // 1平台角色 2租户角色
|
||||
Name string `orm:"column(name);size(32)" json:"name"`
|
||||
Status uint8 `orm:"column(status);default(1)" json:"status"`
|
||||
Rights *string `orm:"column(rights);type(text);null" json:"rights"`
|
||||
CreateTime time.Time `orm:"column(create_time);type(datetime);auto_now_add" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);auto_now;null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *AdminRole) TableName() string {
|
||||
return "yz_system_admin_role"
|
||||
}
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// AdminRole 平台角色表 yz_system_admin_role
|
||||
type AdminRole struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Cid uint8 `orm:"column(cid);default(1)" json:"cid"` // 1平台角色 2租户角色
|
||||
Name string `orm:"column(name);size(32)" json:"name"`
|
||||
Status uint8 `orm:"column(status);default(1)" json:"status"`
|
||||
Rights *string `orm:"column(rights);type(text);null" json:"rights"`
|
||||
CreateTime time.Time `orm:"column(create_time);type(datetime);auto_now_add" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);auto_now;null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *AdminRole) TableName() string {
|
||||
return "yz_system_admin_role"
|
||||
}
|
||||
|
||||
+27
-27
@@ -1,27 +1,27 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// AdminUser 平台管理员信息表 yz_system_admin_user
|
||||
type AdminUser struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Account string `orm:"column(account);size(64)" json:"account"`
|
||||
Password string `orm:"column(password);size(255)" json:"-"`
|
||||
Name *string `orm:"column(name);size(32);null" json:"name"`
|
||||
Phone *string `orm:"column(phone);size(18);null" json:"phone"`
|
||||
Email *string `orm:"column(email);size(255);null" json:"email"`
|
||||
Qq *string `orm:"column(qq);size(16);null" json:"qq"`
|
||||
Sex uint8 `orm:"column(sex);default(0)" json:"sex"`
|
||||
Avatar *string `orm:"column(avatar);size(255);null" json:"avatar"`
|
||||
RoleID uint64 `orm:"column(role_id)" json:"rid"`
|
||||
LoginCount uint64 `orm:"column(login_count);default(0)" json:"login_count"`
|
||||
LastLoginIP *string `orm:"column(last_login_ip);size(255);null" json:"last_login_ip"`
|
||||
Status uint8 `orm:"column(status);default(1)" json:"status"`
|
||||
CreateTime time.Time `orm:"column(create_time);type(datetime);auto_now_add" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);auto_now;null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *AdminUser) TableName() string {
|
||||
return "yz_system_admin_user"
|
||||
}
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// AdminUser 平台管理员信息表 yz_system_admin_user
|
||||
type AdminUser struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Account string `orm:"column(account);size(64)" json:"account"`
|
||||
Password string `orm:"column(password);size(255)" json:"-"`
|
||||
Name *string `orm:"column(name);size(32);null" json:"name"`
|
||||
Phone *string `orm:"column(phone);size(18);null" json:"phone"`
|
||||
Email *string `orm:"column(email);size(255);null" json:"email"`
|
||||
Qq *string `orm:"column(qq);size(16);null" json:"qq"`
|
||||
Sex uint8 `orm:"column(sex);default(0)" json:"sex"`
|
||||
Avatar *string `orm:"column(avatar);size(255);null" json:"avatar"`
|
||||
RoleID uint64 `orm:"column(role_id)" json:"rid"`
|
||||
LoginCount uint64 `orm:"column(login_count);default(0)" json:"login_count"`
|
||||
LastLoginIP *string `orm:"column(last_login_ip);size(255);null" json:"last_login_ip"`
|
||||
Status uint8 `orm:"column(status);default(1)" json:"status"`
|
||||
CreateTime time.Time `orm:"column(create_time);type(datetime);auto_now_add" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);auto_now;null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *AdminUser) TableName() string {
|
||||
return "yz_system_admin_user"
|
||||
}
|
||||
|
||||
+159
-159
@@ -1,159 +1,159 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
)
|
||||
|
||||
// CmsArticleCategory CMS 文章分类 yz_cms_article_category
|
||||
type CmsArticleCategory struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Tid uint64 `orm:"column(tid);default(0)" json:"tid"`
|
||||
Cid uint64 `orm:"column(cid);default(0)" json:"cid"`
|
||||
Name string `orm:"column(name);size(100)" json:"name"`
|
||||
Image string `orm:"column(image);size(500);default()" json:"image"`
|
||||
Desc string `orm:"column(desc);size(500);default()" json:"desc"`
|
||||
Sort int `orm:"column(sort);default(0)" json:"sort"`
|
||||
Status int8 `orm:"column(status);default(1)" json:"status"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *CmsArticleCategory) TableName() string {
|
||||
return "yz_cms_article_category"
|
||||
}
|
||||
|
||||
// CmsArticle CMS 文章 yz_cms_article
|
||||
type CmsArticle struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Tid uint64 `orm:"column(tid);default(0)" json:"tid"`
|
||||
Title string `orm:"column(title);size(255)" json:"title"`
|
||||
Author string `orm:"column(author);size(100);default()" json:"author"`
|
||||
CateID uint64 `orm:"column(cate_id);default(0)" json:"cate_id"`
|
||||
Content string `orm:"column(content);type(mediumtext);null" json:"content"`
|
||||
Desc string `orm:"column(desc);size(500);default()" json:"desc"`
|
||||
Image string `orm:"column(image);size(500);default()" json:"image"`
|
||||
IsTrans int8 `orm:"column(is_trans);default(0)" json:"is_trans"`
|
||||
TransURL *string `orm:"column(transurl);size(500);null" json:"transurl"`
|
||||
Status int8 `orm:"column(status);default(0)" json:"status"`
|
||||
Top int8 `orm:"column(top);default(0)" json:"top"`
|
||||
Recommend int8 `orm:"column(recommend);default(0)" json:"recommend"`
|
||||
Views int `orm:"column(views);default(0)" json:"views"`
|
||||
Likes int `orm:"column(likes);default(0)" json:"likes"`
|
||||
PublisherID *uint64 `orm:"column(publisher_id);null" json:"publisher_id"`
|
||||
PublishTime *time.Time `orm:"column(publish_time);type(datetime);null" json:"publish_time"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *CmsArticle) TableName() string {
|
||||
return "yz_cms_article"
|
||||
}
|
||||
|
||||
var cmsArticleTablesOnce sync.Once
|
||||
|
||||
// EnsureCmsArticleTables 首次使用时自动建表(若不存在)。
|
||||
func EnsureCmsArticleTables() error {
|
||||
var err error
|
||||
cmsArticleTablesOnce.Do(func() {
|
||||
_, err = Orm.Raw(`
|
||||
CREATE TABLE IF NOT EXISTS yz_cms_article_category (
|
||||
id bigint unsigned NOT NULL AUTO_INCREMENT,
|
||||
tid bigint unsigned NOT NULL DEFAULT 0,
|
||||
cid bigint unsigned NOT NULL DEFAULT 0,
|
||||
name varchar(100) NOT NULL DEFAULT '',
|
||||
image varchar(500) NOT NULL DEFAULT '',
|
||||
` + "`desc`" + ` varchar(500) NOT NULL DEFAULT '',
|
||||
sort int NOT NULL DEFAULT 0,
|
||||
status tinyint NOT NULL DEFAULT 1,
|
||||
create_time datetime NOT NULL,
|
||||
update_time datetime DEFAULT NULL,
|
||||
delete_time datetime DEFAULT NULL,
|
||||
PRIMARY KEY (id),
|
||||
KEY idx_tid_cid (tid, cid)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4`).Exec()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
_, err = Orm.Raw(`
|
||||
CREATE TABLE IF NOT EXISTS yz_cms_article (
|
||||
id bigint unsigned NOT NULL AUTO_INCREMENT,
|
||||
tid bigint unsigned NOT NULL DEFAULT 0,
|
||||
title varchar(255) NOT NULL DEFAULT '',
|
||||
author varchar(100) NOT NULL DEFAULT '',
|
||||
cate_id bigint unsigned NOT NULL DEFAULT 0,
|
||||
content mediumtext,
|
||||
` + "`desc`" + ` varchar(500) NOT NULL DEFAULT '',
|
||||
image varchar(500) NOT NULL DEFAULT '',
|
||||
is_trans tinyint NOT NULL DEFAULT 0,
|
||||
transurl varchar(500) DEFAULT NULL,
|
||||
status tinyint NOT NULL DEFAULT 0,
|
||||
top tinyint NOT NULL DEFAULT 0,
|
||||
recommend tinyint NOT NULL DEFAULT 0,
|
||||
views int NOT NULL DEFAULT 0,
|
||||
likes int NOT NULL DEFAULT 0,
|
||||
publisher_id bigint unsigned DEFAULT NULL,
|
||||
publish_time datetime DEFAULT NULL,
|
||||
create_time datetime NOT NULL,
|
||||
update_time datetime DEFAULT NULL,
|
||||
delete_time datetime DEFAULT NULL,
|
||||
PRIMARY KEY (id),
|
||||
KEY idx_tid_status (tid, status),
|
||||
KEY idx_cate_id (cate_id)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4`).Exec()
|
||||
})
|
||||
return err
|
||||
}
|
||||
|
||||
func CmsCategoryNameMap(tid uint64, ids []uint64) map[uint64]string {
|
||||
out := make(map[uint64]string)
|
||||
if len(ids) == 0 {
|
||||
return out
|
||||
}
|
||||
var rows []CmsArticleCategory
|
||||
_, _ = Orm.QueryTable(new(CmsArticleCategory)).
|
||||
Filter("tid", tid).
|
||||
Filter("id__in", ids).
|
||||
Filter("delete_time__isnull", true).
|
||||
All(&rows, "ID", "Name")
|
||||
for _, r := range rows {
|
||||
out[r.ID] = r.Name
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
func CmsFormatTime(t *time.Time) string {
|
||||
if t == nil {
|
||||
return ""
|
||||
}
|
||||
return t.Format("2006-01-02 15:04:05")
|
||||
}
|
||||
|
||||
func CmsSimilarArticles(tid uint64, title string, limit int) ([]orm.Params, error) {
|
||||
if limit <= 0 {
|
||||
limit = 5
|
||||
}
|
||||
var rows []CmsArticle
|
||||
_, err := Orm.QueryTable(new(CmsArticle)).
|
||||
Filter("tid", tid).
|
||||
Filter("delete_time__isnull", true).
|
||||
Filter("title__icontains", title).
|
||||
Limit(limit).
|
||||
All(&rows, "ID", "Title")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
out := make([]orm.Params, 0, len(rows))
|
||||
for _, r := range rows {
|
||||
out = append(out, orm.Params{
|
||||
"id": r.ID,
|
||||
"title": r.Title,
|
||||
"similarity": 80,
|
||||
})
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
package models
|
||||
|
||||
import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
)
|
||||
|
||||
// CmsArticleCategory CMS 文章分类 yz_cms_article_category
|
||||
type CmsArticleCategory struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Tid uint64 `orm:"column(tid);default(0)" json:"tid"`
|
||||
Cid uint64 `orm:"column(cid);default(0)" json:"cid"`
|
||||
Name string `orm:"column(name);size(100)" json:"name"`
|
||||
Image string `orm:"column(image);size(500);default()" json:"image"`
|
||||
Desc string `orm:"column(desc);size(500);default()" json:"desc"`
|
||||
Sort int `orm:"column(sort);default(0)" json:"sort"`
|
||||
Status int8 `orm:"column(status);default(1)" json:"status"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *CmsArticleCategory) TableName() string {
|
||||
return "yz_cms_article_category"
|
||||
}
|
||||
|
||||
// CmsArticle CMS 文章 yz_cms_article
|
||||
type CmsArticle struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Tid uint64 `orm:"column(tid);default(0)" json:"tid"`
|
||||
Title string `orm:"column(title);size(255)" json:"title"`
|
||||
Author string `orm:"column(author);size(100);default()" json:"author"`
|
||||
CateID uint64 `orm:"column(cate_id);default(0)" json:"cate_id"`
|
||||
Content string `orm:"column(content);type(mediumtext);null" json:"content"`
|
||||
Desc string `orm:"column(desc);size(500);default()" json:"desc"`
|
||||
Image string `orm:"column(image);size(500);default()" json:"image"`
|
||||
IsTrans int8 `orm:"column(is_trans);default(0)" json:"is_trans"`
|
||||
TransURL *string `orm:"column(transurl);size(500);null" json:"transurl"`
|
||||
Status int8 `orm:"column(status);default(0)" json:"status"`
|
||||
Top int8 `orm:"column(top);default(0)" json:"top"`
|
||||
Recommend int8 `orm:"column(recommend);default(0)" json:"recommend"`
|
||||
Views int `orm:"column(views);default(0)" json:"views"`
|
||||
Likes int `orm:"column(likes);default(0)" json:"likes"`
|
||||
PublisherID *uint64 `orm:"column(publisher_id);null" json:"publisher_id"`
|
||||
PublishTime *time.Time `orm:"column(publish_time);type(datetime);null" json:"publish_time"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *CmsArticle) TableName() string {
|
||||
return "yz_cms_article"
|
||||
}
|
||||
|
||||
var cmsArticleTablesOnce sync.Once
|
||||
|
||||
// EnsureCmsArticleTables 首次使用时自动建表(若不存在)。
|
||||
func EnsureCmsArticleTables() error {
|
||||
var err error
|
||||
cmsArticleTablesOnce.Do(func() {
|
||||
_, err = Orm.Raw(`
|
||||
CREATE TABLE IF NOT EXISTS yz_cms_article_category (
|
||||
id bigint unsigned NOT NULL AUTO_INCREMENT,
|
||||
tid bigint unsigned NOT NULL DEFAULT 0,
|
||||
cid bigint unsigned NOT NULL DEFAULT 0,
|
||||
name varchar(100) NOT NULL DEFAULT '',
|
||||
image varchar(500) NOT NULL DEFAULT '',
|
||||
` + "`desc`" + ` varchar(500) NOT NULL DEFAULT '',
|
||||
sort int NOT NULL DEFAULT 0,
|
||||
status tinyint NOT NULL DEFAULT 1,
|
||||
create_time datetime NOT NULL,
|
||||
update_time datetime DEFAULT NULL,
|
||||
delete_time datetime DEFAULT NULL,
|
||||
PRIMARY KEY (id),
|
||||
KEY idx_tid_cid (tid, cid)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4`).Exec()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
_, err = Orm.Raw(`
|
||||
CREATE TABLE IF NOT EXISTS yz_cms_article (
|
||||
id bigint unsigned NOT NULL AUTO_INCREMENT,
|
||||
tid bigint unsigned NOT NULL DEFAULT 0,
|
||||
title varchar(255) NOT NULL DEFAULT '',
|
||||
author varchar(100) NOT NULL DEFAULT '',
|
||||
cate_id bigint unsigned NOT NULL DEFAULT 0,
|
||||
content mediumtext,
|
||||
` + "`desc`" + ` varchar(500) NOT NULL DEFAULT '',
|
||||
image varchar(500) NOT NULL DEFAULT '',
|
||||
is_trans tinyint NOT NULL DEFAULT 0,
|
||||
transurl varchar(500) DEFAULT NULL,
|
||||
status tinyint NOT NULL DEFAULT 0,
|
||||
top tinyint NOT NULL DEFAULT 0,
|
||||
recommend tinyint NOT NULL DEFAULT 0,
|
||||
views int NOT NULL DEFAULT 0,
|
||||
likes int NOT NULL DEFAULT 0,
|
||||
publisher_id bigint unsigned DEFAULT NULL,
|
||||
publish_time datetime DEFAULT NULL,
|
||||
create_time datetime NOT NULL,
|
||||
update_time datetime DEFAULT NULL,
|
||||
delete_time datetime DEFAULT NULL,
|
||||
PRIMARY KEY (id),
|
||||
KEY idx_tid_status (tid, status),
|
||||
KEY idx_cate_id (cate_id)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4`).Exec()
|
||||
})
|
||||
return err
|
||||
}
|
||||
|
||||
func CmsCategoryNameMap(tid uint64, ids []uint64) map[uint64]string {
|
||||
out := make(map[uint64]string)
|
||||
if len(ids) == 0 {
|
||||
return out
|
||||
}
|
||||
var rows []CmsArticleCategory
|
||||
_, _ = Orm.QueryTable(new(CmsArticleCategory)).
|
||||
Filter("tid", tid).
|
||||
Filter("id__in", ids).
|
||||
Filter("delete_time__isnull", true).
|
||||
All(&rows, "ID", "Name")
|
||||
for _, r := range rows {
|
||||
out[r.ID] = r.Name
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
func CmsFormatTime(t *time.Time) string {
|
||||
if t == nil {
|
||||
return ""
|
||||
}
|
||||
return t.Format("2006-01-02 15:04:05")
|
||||
}
|
||||
|
||||
func CmsSimilarArticles(tid uint64, title string, limit int) ([]orm.Params, error) {
|
||||
if limit <= 0 {
|
||||
limit = 5
|
||||
}
|
||||
var rows []CmsArticle
|
||||
_, err := Orm.QueryTable(new(CmsArticle)).
|
||||
Filter("tid", tid).
|
||||
Filter("delete_time__isnull", true).
|
||||
Filter("title__icontains", title).
|
||||
Limit(limit).
|
||||
All(&rows, "ID", "Title")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
out := make([]orm.Params, 0, len(rows))
|
||||
for _, r := range rows {
|
||||
out = append(out, orm.Params{
|
||||
"id": r.ID,
|
||||
"title": r.Title,
|
||||
"similarity": 80,
|
||||
})
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// ComplaintCategory 投诉建议产品分类 yz_system_complaint_category
|
||||
type ComplaintCategory struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Name string `orm:"column(name);size(64)" json:"name"`
|
||||
Code *string `orm:"column(code);size(32);null" json:"code"`
|
||||
Sort int `orm:"column(sort);default(0)" json:"sort"`
|
||||
Status int8 `orm:"column(status);default(1)" json:"status"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"createTime"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);auto_now;type(datetime);null" json:"updateTime"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"deleteTime"`
|
||||
}
|
||||
|
||||
func (c *ComplaintCategory) TableName() string {
|
||||
return "yz_system_complaint_category"
|
||||
}
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// ComplaintCategory 投诉建议产品分类 yz_system_complaint_category
|
||||
type ComplaintCategory struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Name string `orm:"column(name);size(64)" json:"name"`
|
||||
Code *string `orm:"column(code);size(32);null" json:"code"`
|
||||
Sort int `orm:"column(sort);default(0)" json:"sort"`
|
||||
Status int8 `orm:"column(status);default(1)" json:"status"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"createTime"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);auto_now;type(datetime);null" json:"updateTime"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"deleteTime"`
|
||||
}
|
||||
|
||||
func (c *ComplaintCategory) TableName() string {
|
||||
return "yz_system_complaint_category"
|
||||
}
|
||||
|
||||
+73
-73
@@ -1,73 +1,73 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// BackendErpOrganization 组织架构表 yz_backend_erp_organization
|
||||
type BackendErpOrganization struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Tid uint64 `orm:"column(tid)" json:"tid"`
|
||||
OrgName string `orm:"column(org_name);size(128)" json:"org_name"`
|
||||
OrgCode string `orm:"column(org_code);size(64)" json:"org_code"`
|
||||
ParentID uint64 `orm:"column(parent_id);default(0)" json:"parent_id"`
|
||||
Sort uint `orm:"column(sort);default(0)" json:"sort"`
|
||||
LeaderID *uint64 `orm:"column(leader_id);null" json:"leader_id"`
|
||||
IsCompany int `orm:"column(is_company);default(0)" json:"is_company"`
|
||||
Status int8 `orm:"column(status);default(1)" json:"status"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
||||
UpdateTime time.Time `orm:"column(update_time);auto_now;type(datetime)" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
Remark *string `orm:"column(remark);size(512);null" json:"remark"`
|
||||
}
|
||||
|
||||
// TableName 自定义表名
|
||||
func (m *BackendErpOrganization) TableName() string {
|
||||
return "yz_backend_erp_organization"
|
||||
}
|
||||
|
||||
// BackendErpEmployee 员工信息表 yz_backend_erp_employee
|
||||
type BackendErpEmployee struct {
|
||||
ID uint `orm:"column(id);pk;auto" json:"id"`
|
||||
Tid *int `orm:"column(tid);null" json:"tid"`
|
||||
Account string `orm:"column(account);size(50)" json:"account"`
|
||||
Password string `orm:"column(password);size(64);default()" json:"-"`
|
||||
Name string `orm:"column(name);size(30)" json:"name"`
|
||||
Gender int8 `orm:"column(gender);default(0)" json:"gender"`
|
||||
Birthday *time.Time `orm:"column(birthday);type(date);null" json:"birthday"`
|
||||
AffiliateUnit *string `orm:"column(affiliate_unit);size(100);null" json:"affiliate_unit"`
|
||||
Department *string `orm:"column(department);size(50);null" json:"department"`
|
||||
Position *string `orm:"column(position);size(50);null" json:"position"`
|
||||
Education *string `orm:"column(education);size(20);null" json:"education"`
|
||||
Nation *string `orm:"column(nation);size(20);null" json:"nation"`
|
||||
Phone *string `orm:"column(phone);size(20);null" json:"phone"`
|
||||
Wechat *string `orm:"column(wechat);size(50);null" json:"wechat"`
|
||||
Email *string `orm:"column(email);size(100);null" json:"email"`
|
||||
HomeAddress *string `orm:"column(home_address);size(255);null" json:"home_address"`
|
||||
AccountStatus int8 `orm:"column(account_status);default(1)" json:"account_status"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
||||
UpdateTime time.Time `orm:"column(update_time);auto_now;type(datetime)" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
// TableName 自定义表名
|
||||
func (m *BackendErpEmployee) TableName() string {
|
||||
return "yz_backend_erp_employee"
|
||||
}
|
||||
|
||||
// BackendErpPosition 职位表 yz_backend_erp_position
|
||||
type BackendErpPosition struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
TenantID uint64 `orm:"column(tenant_id)" json:"tenant_id"`
|
||||
DepartmentID uint64 `orm:"column(department_id)" json:"department_id"`
|
||||
PositionCode string `orm:"column(position_code);size(50)" json:"position_code"`
|
||||
PositionName string `orm:"column(position_name);size(100)" json:"position_name"`
|
||||
PositionType int8 `orm:"column(position_type);default(0)" json:"position_type"`
|
||||
Status int8 `orm:"column(status);default(1)" json:"status"`
|
||||
Sort uint `orm:"column(sort);default(0)" json:"sort"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
||||
UpdateTime time.Time `orm:"column(update_time);auto_now;type(datetime)" json:"update_time"`
|
||||
}
|
||||
|
||||
// TableName 自定义表名
|
||||
func (m *BackendErpPosition) TableName() string {
|
||||
return "yz_backend_erp_position"
|
||||
}
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// BackendErpOrganization 组织架构表 yz_backend_erp_organization
|
||||
type BackendErpOrganization struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Tid uint64 `orm:"column(tid)" json:"tid"`
|
||||
OrgName string `orm:"column(org_name);size(128)" json:"org_name"`
|
||||
OrgCode string `orm:"column(org_code);size(64)" json:"org_code"`
|
||||
ParentID uint64 `orm:"column(parent_id);default(0)" json:"parent_id"`
|
||||
Sort uint `orm:"column(sort);default(0)" json:"sort"`
|
||||
LeaderID *uint64 `orm:"column(leader_id);null" json:"leader_id"`
|
||||
IsCompany int `orm:"column(is_company);default(0)" json:"is_company"`
|
||||
Status int8 `orm:"column(status);default(1)" json:"status"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
||||
UpdateTime time.Time `orm:"column(update_time);auto_now;type(datetime)" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
Remark *string `orm:"column(remark);size(512);null" json:"remark"`
|
||||
}
|
||||
|
||||
// TableName 自定义表名
|
||||
func (m *BackendErpOrganization) TableName() string {
|
||||
return "yz_backend_erp_organization"
|
||||
}
|
||||
|
||||
// BackendErpEmployee 员工信息表 yz_backend_erp_employee
|
||||
type BackendErpEmployee struct {
|
||||
ID uint `orm:"column(id);pk;auto" json:"id"`
|
||||
Tid *int `orm:"column(tid);null" json:"tid"`
|
||||
Account string `orm:"column(account);size(50)" json:"account"`
|
||||
Password string `orm:"column(password);size(64);default()" json:"-"`
|
||||
Name string `orm:"column(name);size(30)" json:"name"`
|
||||
Gender int8 `orm:"column(gender);default(0)" json:"gender"`
|
||||
Birthday *time.Time `orm:"column(birthday);type(date);null" json:"birthday"`
|
||||
AffiliateUnit *string `orm:"column(affiliate_unit);size(100);null" json:"affiliate_unit"`
|
||||
Department *string `orm:"column(department);size(50);null" json:"department"`
|
||||
Position *string `orm:"column(position);size(50);null" json:"position"`
|
||||
Education *string `orm:"column(education);size(20);null" json:"education"`
|
||||
Nation *string `orm:"column(nation);size(20);null" json:"nation"`
|
||||
Phone *string `orm:"column(phone);size(20);null" json:"phone"`
|
||||
Wechat *string `orm:"column(wechat);size(50);null" json:"wechat"`
|
||||
Email *string `orm:"column(email);size(100);null" json:"email"`
|
||||
HomeAddress *string `orm:"column(home_address);size(255);null" json:"home_address"`
|
||||
AccountStatus int8 `orm:"column(account_status);default(1)" json:"account_status"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
||||
UpdateTime time.Time `orm:"column(update_time);auto_now;type(datetime)" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
// TableName 自定义表名
|
||||
func (m *BackendErpEmployee) TableName() string {
|
||||
return "yz_backend_erp_employee"
|
||||
}
|
||||
|
||||
// BackendErpPosition 职位表 yz_backend_erp_position
|
||||
type BackendErpPosition struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
TenantID uint64 `orm:"column(tenant_id)" json:"tenant_id"`
|
||||
DepartmentID uint64 `orm:"column(department_id)" json:"department_id"`
|
||||
PositionCode string `orm:"column(position_code);size(50)" json:"position_code"`
|
||||
PositionName string `orm:"column(position_name);size(100)" json:"position_name"`
|
||||
PositionType int8 `orm:"column(position_type);default(0)" json:"position_type"`
|
||||
Status int8 `orm:"column(status);default(1)" json:"status"`
|
||||
Sort uint `orm:"column(sort);default(0)" json:"sort"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
||||
UpdateTime time.Time `orm:"column(update_time);auto_now;type(datetime)" json:"update_time"`
|
||||
}
|
||||
|
||||
// TableName 自定义表名
|
||||
func (m *BackendErpPosition) TableName() string {
|
||||
return "yz_backend_erp_position"
|
||||
}
|
||||
|
||||
+81
-81
@@ -1,81 +1,81 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
beego "github.com/beego/beego/v2/server/web"
|
||||
_ "github.com/go-sql-driver/mysql"
|
||||
)
|
||||
|
||||
// Orm 全局 ORM 对象,供业务层和控制器使用
|
||||
var Orm orm.Ormer
|
||||
|
||||
// Init 初始化模型层资源(数据库连接、模型注册等)。
|
||||
func Init(_ string) {
|
||||
// 从配置读取数据库连接信息
|
||||
user, _ := beego.AppConfig.String("mysqluser")
|
||||
pass, _ := beego.AppConfig.String("mysqlpass")
|
||||
urls, _ := beego.AppConfig.String("mysqlurls")
|
||||
dbname, _ := beego.AppConfig.String("mysqldb")
|
||||
|
||||
if user == "" || urls == "" || dbname == "" {
|
||||
panic("数据库配置(mysqluser/mysqlurls/mysqldb) 未正确设置")
|
||||
}
|
||||
|
||||
// 组装 DSN:user:pass@tcp(host:port)/dbname?charset=utf8mb4&parseTime=True&loc=Local
|
||||
dsn := fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8mb4&parseTime=True&loc=Local", user, pass, urls, dbname)
|
||||
|
||||
// 注册默认数据库
|
||||
if err := orm.RegisterDataBase("default", "mysql", dsn); err != nil {
|
||||
panic("注册数据库失败: " + err.Error())
|
||||
}
|
||||
|
||||
// 注册模型
|
||||
orm.RegisterModel(
|
||||
new(SystemTenant),
|
||||
new(SystemTenantUser),
|
||||
new(BackendErpOrganization),
|
||||
new(BackendErpEmployee),
|
||||
new(BackendErpPosition),
|
||||
new(SystemMenu),
|
||||
new(AdminUser),
|
||||
new(AdminRole),
|
||||
new(SystemFile),
|
||||
new(SystemFilesCategory),
|
||||
new(SystemSMSTask),
|
||||
new(SystemOperationLog),
|
||||
new(SystemDomainPool),
|
||||
new(SystemTenantDomain),
|
||||
new(SystemModules),
|
||||
new(StorageConfig),
|
||||
new(TenantSiteSetting),
|
||||
new(ComplaintCategory),
|
||||
new(PlatformComplaint),
|
||||
new(SystemSoftwareUpgrade),
|
||||
new(PlatformCursorEquipment),
|
||||
new(PlatformCursorActivationCode),
|
||||
new(PlatformCursorEquipmentIpLog),
|
||||
new(PlatformAccountPoolKiro),
|
||||
new(PlatformAccountPoolWindsurf),
|
||||
new(PlatformAccountPoolCursor),
|
||||
new(PlatformAccountPoolCodex),
|
||||
new(PlatformNotebook),
|
||||
|
||||
new(CmsArticleCategory),
|
||||
new(CmsArticle),
|
||||
|
||||
new(SystemReminderList),
|
||||
|
||||
new(SystemNormalSetting),
|
||||
new(PlatformNormalSetting),
|
||||
new(BackendNormalSetting),
|
||||
|
||||
new(PlatformSchedule),
|
||||
new(PlatformScheduleReminder),
|
||||
new(PlatformScheduleReminderSendLog),
|
||||
)
|
||||
|
||||
// 创建全局 Ormer
|
||||
Orm = orm.NewOrm()
|
||||
}
|
||||
package models
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
beego "github.com/beego/beego/v2/server/web"
|
||||
_ "github.com/go-sql-driver/mysql"
|
||||
)
|
||||
|
||||
// Orm 全局 ORM 对象,供业务层和控制器使用
|
||||
var Orm orm.Ormer
|
||||
|
||||
// Init 初始化模型层资源(数据库连接、模型注册等)。
|
||||
func Init(_ string) {
|
||||
// 从配置读取数据库连接信息
|
||||
user, _ := beego.AppConfig.String("mysqluser")
|
||||
pass, _ := beego.AppConfig.String("mysqlpass")
|
||||
urls, _ := beego.AppConfig.String("mysqlurls")
|
||||
dbname, _ := beego.AppConfig.String("mysqldb")
|
||||
|
||||
if user == "" || urls == "" || dbname == "" {
|
||||
panic("数据库配置(mysqluser/mysqlurls/mysqldb) 未正确设置")
|
||||
}
|
||||
|
||||
// 组装 DSN:user:pass@tcp(host:port)/dbname?charset=utf8mb4&parseTime=True&loc=Local
|
||||
dsn := fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8mb4&parseTime=True&loc=Local", user, pass, urls, dbname)
|
||||
|
||||
// 注册默认数据库
|
||||
if err := orm.RegisterDataBase("default", "mysql", dsn); err != nil {
|
||||
panic("注册数据库失败: " + err.Error())
|
||||
}
|
||||
|
||||
// 注册模型
|
||||
orm.RegisterModel(
|
||||
new(SystemTenant),
|
||||
new(SystemTenantUser),
|
||||
new(BackendErpOrganization),
|
||||
new(BackendErpEmployee),
|
||||
new(BackendErpPosition),
|
||||
new(SystemMenu),
|
||||
new(AdminUser),
|
||||
new(AdminRole),
|
||||
new(SystemFile),
|
||||
new(SystemFilesCategory),
|
||||
new(SystemSMSTask),
|
||||
new(SystemOperationLog),
|
||||
new(SystemDomainPool),
|
||||
new(SystemTenantDomain),
|
||||
new(SystemModules),
|
||||
new(StorageConfig),
|
||||
new(TenantSiteSetting),
|
||||
new(ComplaintCategory),
|
||||
new(PlatformComplaint),
|
||||
new(SystemSoftwareUpgrade),
|
||||
new(PlatformCursorEquipment),
|
||||
new(PlatformCursorActivationCode),
|
||||
new(PlatformCursorEquipmentIpLog),
|
||||
new(PlatformAccountPoolKiro),
|
||||
new(PlatformAccountPoolWindsurf),
|
||||
new(PlatformAccountPoolCursor),
|
||||
new(PlatformAccountPoolCodex),
|
||||
new(PlatformNotebook),
|
||||
|
||||
new(CmsArticleCategory),
|
||||
new(CmsArticle),
|
||||
|
||||
new(SystemReminderList),
|
||||
|
||||
new(SystemNormalSetting),
|
||||
new(PlatformNormalSetting),
|
||||
new(BackendNormalSetting),
|
||||
|
||||
new(PlatformSchedule),
|
||||
new(PlatformScheduleReminder),
|
||||
new(PlatformScheduleReminderSendLog),
|
||||
)
|
||||
|
||||
// 创建全局 Ormer
|
||||
Orm = orm.NewOrm()
|
||||
}
|
||||
|
||||
@@ -1,86 +1,86 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// PlatformAccountPoolKiro 号池表: yz_platform_account_pool_krio
|
||||
type PlatformAccountPoolKiro struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
DataType string `orm:"column(data_type);size(32)" json:"data_type"` // account | tk | account_tk
|
||||
Account string `orm:"column(account);size(128);default()" json:"account"`
|
||||
Password string `orm:"column(password);size(255);default()" json:"password"`
|
||||
Token string `orm:"column(token);type(text);null" json:"token"`
|
||||
Remark string `orm:"column(remark);size(255);default()" json:"remark"`
|
||||
IsExtracted int8 `orm:"column(is_extracted);default(0)" json:"is_extracted"`
|
||||
ExtractedTime *time.Time `orm:"column(extracted_time);type(datetime);null" json:"extracted_time"`
|
||||
ExtractedPlatform *string `orm:"column(extracted_platform);size(32);null" json:"extracted_platform"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *PlatformAccountPoolKiro) TableName() string {
|
||||
return "yz_platform_account_pool_krio"
|
||||
}
|
||||
|
||||
// PlatformAccountPoolCodex 号池表: yz_platform_account_pool_codex
|
||||
type PlatformAccountPoolCodex struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
DataType string `orm:"column(data_type);size(32)" json:"data_type"` // account | tk | account_tk
|
||||
Account string `orm:"column(account);size(128);default()" json:"account"`
|
||||
Password string `orm:"column(password);size(255);default()" json:"password"`
|
||||
Token string `orm:"column(token);type(text);null" json:"token"`
|
||||
Remark string `orm:"column(remark);size(255);default()" json:"remark"`
|
||||
IsExtracted int8 `orm:"column(is_extracted);default(0)" json:"is_extracted"`
|
||||
ExtractedTime *time.Time `orm:"column(extracted_time);type(datetime);null" json:"extracted_time"`
|
||||
ExtractedPlatform *string `orm:"column(extracted_platform);size(32);null" json:"extracted_platform"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *PlatformAccountPoolCodex) TableName() string {
|
||||
return "yz_platform_account_pool_codex"
|
||||
}
|
||||
|
||||
|
||||
// PlatformAccountPoolWindsurf 号池表: yz_platform_account_pool_windsurf
|
||||
type PlatformAccountPoolWindsurf struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
DataType string `orm:"column(data_type);size(32)" json:"data_type"` // account | tk | account_tk
|
||||
Account string `orm:"column(account);size(128);default()" json:"account"`
|
||||
Password string `orm:"column(password);size(255);default()" json:"password"`
|
||||
Token string `orm:"column(token);type(text);null" json:"token"`
|
||||
Remark string `orm:"column(remark);size(255);default()" json:"remark"`
|
||||
IsExtracted int8 `orm:"column(is_extracted);default(0)" json:"is_extracted"`
|
||||
ExtractedTime *time.Time `orm:"column(extracted_time);type(datetime);null" json:"extracted_time"`
|
||||
ExtractedPlatform *string `orm:"column(extracted_platform);size(32);null" json:"extracted_platform"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *PlatformAccountPoolWindsurf) TableName() string {
|
||||
return "yz_platform_account_pool_windsurf"
|
||||
}
|
||||
|
||||
// PlatformAccountPoolCursor 号池表: yz_platform_account_pool_cursor
|
||||
type PlatformAccountPoolCursor struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
DataType string `orm:"column(data_type);size(32)" json:"data_type"` // account | tk | account_tk
|
||||
Account string `orm:"column(account);size(128);default()" json:"account"`
|
||||
Password string `orm:"column(password);size(255);default()" json:"password"`
|
||||
Token string `orm:"column(token);type(text);null" json:"token"`
|
||||
Remark string `orm:"column(remark);size(255);default()" json:"remark"`
|
||||
IsExtracted int8 `orm:"column(is_extracted);default(0)" json:"is_extracted"`
|
||||
IsUsed *int8 `orm:"column(is_used);null" json:"is_used"` // 0=用完/不可用 1=可用 NULL=未探测
|
||||
ExtractedTime *time.Time `orm:"column(extracted_time);type(datetime);null" json:"extracted_time"`
|
||||
ExtractedPlatform *string `orm:"column(extracted_platform);size(32);null" json:"extracted_platform"`
|
||||
MachineCode string `orm:"column(machine_code);size(128);default('')" json:"machine_code"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *PlatformAccountPoolCursor) TableName() string {
|
||||
return "yz_platform_account_pool_cursor"
|
||||
}
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// PlatformAccountPoolKiro 号池表: yz_platform_account_pool_krio
|
||||
type PlatformAccountPoolKiro struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
DataType string `orm:"column(data_type);size(32)" json:"data_type"` // account | tk | account_tk
|
||||
Account string `orm:"column(account);size(128);default()" json:"account"`
|
||||
Password string `orm:"column(password);size(255);default()" json:"password"`
|
||||
Token string `orm:"column(token);type(text);null" json:"token"`
|
||||
Remark string `orm:"column(remark);size(255);default()" json:"remark"`
|
||||
IsExtracted int8 `orm:"column(is_extracted);default(0)" json:"is_extracted"`
|
||||
ExtractedTime *time.Time `orm:"column(extracted_time);type(datetime);null" json:"extracted_time"`
|
||||
ExtractedPlatform *string `orm:"column(extracted_platform);size(32);null" json:"extracted_platform"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *PlatformAccountPoolKiro) TableName() string {
|
||||
return "yz_platform_account_pool_krio"
|
||||
}
|
||||
|
||||
// PlatformAccountPoolCodex 号池表: yz_platform_account_pool_codex
|
||||
type PlatformAccountPoolCodex struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
DataType string `orm:"column(data_type);size(32)" json:"data_type"` // account | tk | account_tk
|
||||
Account string `orm:"column(account);size(128);default()" json:"account"`
|
||||
Password string `orm:"column(password);size(255);default()" json:"password"`
|
||||
Token string `orm:"column(token);type(text);null" json:"token"`
|
||||
Remark string `orm:"column(remark);size(255);default()" json:"remark"`
|
||||
IsExtracted int8 `orm:"column(is_extracted);default(0)" json:"is_extracted"`
|
||||
ExtractedTime *time.Time `orm:"column(extracted_time);type(datetime);null" json:"extracted_time"`
|
||||
ExtractedPlatform *string `orm:"column(extracted_platform);size(32);null" json:"extracted_platform"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *PlatformAccountPoolCodex) TableName() string {
|
||||
return "yz_platform_account_pool_codex"
|
||||
}
|
||||
|
||||
|
||||
// PlatformAccountPoolWindsurf 号池表: yz_platform_account_pool_windsurf
|
||||
type PlatformAccountPoolWindsurf struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
DataType string `orm:"column(data_type);size(32)" json:"data_type"` // account | tk | account_tk
|
||||
Account string `orm:"column(account);size(128);default()" json:"account"`
|
||||
Password string `orm:"column(password);size(255);default()" json:"password"`
|
||||
Token string `orm:"column(token);type(text);null" json:"token"`
|
||||
Remark string `orm:"column(remark);size(255);default()" json:"remark"`
|
||||
IsExtracted int8 `orm:"column(is_extracted);default(0)" json:"is_extracted"`
|
||||
ExtractedTime *time.Time `orm:"column(extracted_time);type(datetime);null" json:"extracted_time"`
|
||||
ExtractedPlatform *string `orm:"column(extracted_platform);size(32);null" json:"extracted_platform"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *PlatformAccountPoolWindsurf) TableName() string {
|
||||
return "yz_platform_account_pool_windsurf"
|
||||
}
|
||||
|
||||
// PlatformAccountPoolCursor 号池表: yz_platform_account_pool_cursor
|
||||
type PlatformAccountPoolCursor struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
DataType string `orm:"column(data_type);size(32)" json:"data_type"` // account | tk | account_tk
|
||||
Account string `orm:"column(account);size(128);default()" json:"account"`
|
||||
Password string `orm:"column(password);size(255);default()" json:"password"`
|
||||
Token string `orm:"column(token);type(text);null" json:"token"`
|
||||
Remark string `orm:"column(remark);size(255);default()" json:"remark"`
|
||||
IsExtracted int8 `orm:"column(is_extracted);default(0)" json:"is_extracted"`
|
||||
IsUsed *int8 `orm:"column(is_used);null" json:"is_used"` // 0=用完/不可用 1=可用 NULL=未探测
|
||||
ExtractedTime *time.Time `orm:"column(extracted_time);type(datetime);null" json:"extracted_time"`
|
||||
ExtractedPlatform *string `orm:"column(extracted_platform);size(32);null" json:"extracted_platform"`
|
||||
MachineCode string `orm:"column(machine_code);size(128);default('')" json:"machine_code"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *PlatformAccountPoolCursor) TableName() string {
|
||||
return "yz_platform_account_pool_cursor"
|
||||
}
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// PlatformComplaint 平台投诉建议 yz_system_platform_complaint
|
||||
type PlatformComplaint struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
CategoryID uint64 `orm:"column(category_id)" json:"categoryId"`
|
||||
Title string `orm:"column(title);size(200)" json:"title"`
|
||||
Content string `orm:"column(content);type(text)" json:"content"`
|
||||
ContactName *string `orm:"column(contact_name);size(64);null" json:"contactName"`
|
||||
ContactPhone *string `orm:"column(contact_phone);size(32);null" json:"contactPhone"`
|
||||
ContactEmail *string `orm:"column(contact_email);size(128);null" json:"contactEmail"`
|
||||
Status int8 `orm:"column(status);default(0)" json:"status"`
|
||||
ReplyContent *string `orm:"column(reply_content);type(text);null" json:"replyContent"`
|
||||
ReplyTime *time.Time `orm:"column(reply_time);type(datetime);null" json:"replyTime"`
|
||||
Tid *uint64 `orm:"column(tid);null" json:"tid"`
|
||||
Remark *string `orm:"column(remark);size(512);null" json:"remark"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"createTime"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);auto_now;type(datetime);null" json:"updateTime"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"deleteTime"`
|
||||
}
|
||||
|
||||
func (p *PlatformComplaint) TableName() string {
|
||||
return "yz_system_platform_complaint"
|
||||
}
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// PlatformComplaint 平台投诉建议 yz_system_platform_complaint
|
||||
type PlatformComplaint struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
CategoryID uint64 `orm:"column(category_id)" json:"categoryId"`
|
||||
Title string `orm:"column(title);size(200)" json:"title"`
|
||||
Content string `orm:"column(content);type(text)" json:"content"`
|
||||
ContactName *string `orm:"column(contact_name);size(64);null" json:"contactName"`
|
||||
ContactPhone *string `orm:"column(contact_phone);size(32);null" json:"contactPhone"`
|
||||
ContactEmail *string `orm:"column(contact_email);size(128);null" json:"contactEmail"`
|
||||
Status int8 `orm:"column(status);default(0)" json:"status"`
|
||||
ReplyContent *string `orm:"column(reply_content);type(text);null" json:"replyContent"`
|
||||
ReplyTime *time.Time `orm:"column(reply_time);type(datetime);null" json:"replyTime"`
|
||||
Tid *uint64 `orm:"column(tid);null" json:"tid"`
|
||||
Remark *string `orm:"column(remark);size(512);null" json:"remark"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"createTime"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);auto_now;type(datetime);null" json:"updateTime"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"deleteTime"`
|
||||
}
|
||||
|
||||
func (p *PlatformComplaint) TableName() string {
|
||||
return "yz_system_platform_complaint"
|
||||
}
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// PlatformCursorActivationCode Cursor 续杯激活码 yz_platform_cursor_activation_code
|
||||
type PlatformCursorActivationCode struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Code string `orm:"column(code);size(128);unique" json:"code"`
|
||||
Type int `orm:"column(type);default(30)" json:"type"`
|
||||
Status int8 `orm:"column(status);default(0)" json:"status"`
|
||||
DurationDays int `orm:"column(duration_days);default(30)" json:"durationDays"`
|
||||
BindAccount *string `orm:"column(bind_account);size(128);null" json:"bindAccount"`
|
||||
BindDeviceID *uint64 `orm:"column(bind_device_id);null" json:"bindDeviceId"`
|
||||
MachineCode *string `orm:"column(machine_code);size(128);null" json:"machineCode"`
|
||||
DeviceInfo *string `orm:"column(device_info);size(1000);null" json:"deviceInfo"`
|
||||
OwnerUserID *uint64 `orm:"column(owner_user_id);null" json:"ownerUserId"`
|
||||
OwnerUserName *string `orm:"column(owner_user_name);size(128);null" json:"ownerUserName"`
|
||||
ActivatedAt *time.Time `orm:"column(activated_at);type(datetime);null" json:"activatedAt"`
|
||||
ExpiredAt *time.Time `orm:"column(expired_at);type(datetime);null" json:"expiredAt"`
|
||||
Remark *string `orm:"column(remark);size(1000);null" json:"remark"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"createTime"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);auto_now;type(datetime);null" json:"updateTime"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"deleteTime"`
|
||||
}
|
||||
|
||||
func (m *PlatformCursorActivationCode) TableName() string {
|
||||
return "yz_platform_cursor_activation_code"
|
||||
}
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// PlatformCursorActivationCode Cursor 续杯激活码 yz_platform_cursor_activation_code
|
||||
type PlatformCursorActivationCode struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Code string `orm:"column(code);size(128);unique" json:"code"`
|
||||
Type int `orm:"column(type);default(30)" json:"type"`
|
||||
Status int8 `orm:"column(status);default(0)" json:"status"`
|
||||
DurationDays int `orm:"column(duration_days);default(30)" json:"durationDays"`
|
||||
BindAccount *string `orm:"column(bind_account);size(128);null" json:"bindAccount"`
|
||||
BindDeviceID *uint64 `orm:"column(bind_device_id);null" json:"bindDeviceId"`
|
||||
MachineCode *string `orm:"column(machine_code);size(128);null" json:"machineCode"`
|
||||
DeviceInfo *string `orm:"column(device_info);size(1000);null" json:"deviceInfo"`
|
||||
OwnerUserID *uint64 `orm:"column(owner_user_id);null" json:"ownerUserId"`
|
||||
OwnerUserName *string `orm:"column(owner_user_name);size(128);null" json:"ownerUserName"`
|
||||
ActivatedAt *time.Time `orm:"column(activated_at);type(datetime);null" json:"activatedAt"`
|
||||
ExpiredAt *time.Time `orm:"column(expired_at);type(datetime);null" json:"expiredAt"`
|
||||
Remark *string `orm:"column(remark);size(1000);null" json:"remark"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"createTime"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);auto_now;type(datetime);null" json:"updateTime"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"deleteTime"`
|
||||
}
|
||||
|
||||
func (m *PlatformCursorActivationCode) TableName() string {
|
||||
return "yz_platform_cursor_activation_code"
|
||||
}
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// PlatformCursorEquipment Cursor 设备管理 yz_platform_cursor_equipment
|
||||
type PlatformCursorEquipment struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
DeviceInfo *string `orm:"column(device_info);size(1000);null" json:"deviceInfo"`
|
||||
MachineCode string `orm:"column(machine_code);size(128);unique" json:"machineCode"`
|
||||
Status int8 `orm:"column(status);default(0)" json:"status"`
|
||||
System *string `orm:"column(system);size(64);null" json:"system"`
|
||||
Version *string `orm:"column(version);size(64);null" json:"version"`
|
||||
BindAccount *string `orm:"column(bind_account);size(128);null" json:"bindAccount"`
|
||||
OwnerUserID *uint64 `orm:"column(owner_user_id);null" json:"ownerUserId"`
|
||||
OwnerUserName *string `orm:"column(owner_user_name);size(128);null" json:"ownerUserName"`
|
||||
ActivationTime *time.Time `orm:"column(activation_time);type(datetime);null" json:"activationTime"`
|
||||
ExpireTime *time.Time `orm:"column(expire_time);type(datetime);null" json:"expireTime"`
|
||||
Remark *string `orm:"column(remark);size(1000);null" json:"remark"`
|
||||
LastHeartbeatAt *time.Time `orm:"column(last_heartbeat_at);type(datetime);null" json:"lastHeartbeatAt"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"createTime"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);auto_now;type(datetime);null" json:"updateTime"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"deleteTime"`
|
||||
}
|
||||
|
||||
func (m *PlatformCursorEquipment) TableName() string {
|
||||
return "yz_platform_cursor_equipment"
|
||||
}
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// PlatformCursorEquipment Cursor 设备管理 yz_platform_cursor_equipment
|
||||
type PlatformCursorEquipment struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
DeviceInfo *string `orm:"column(device_info);size(1000);null" json:"deviceInfo"`
|
||||
MachineCode string `orm:"column(machine_code);size(128);unique" json:"machineCode"`
|
||||
Status int8 `orm:"column(status);default(0)" json:"status"`
|
||||
System *string `orm:"column(system);size(64);null" json:"system"`
|
||||
Version *string `orm:"column(version);size(64);null" json:"version"`
|
||||
BindAccount *string `orm:"column(bind_account);size(128);null" json:"bindAccount"`
|
||||
OwnerUserID *uint64 `orm:"column(owner_user_id);null" json:"ownerUserId"`
|
||||
OwnerUserName *string `orm:"column(owner_user_name);size(128);null" json:"ownerUserName"`
|
||||
ActivationTime *time.Time `orm:"column(activation_time);type(datetime);null" json:"activationTime"`
|
||||
ExpireTime *time.Time `orm:"column(expire_time);type(datetime);null" json:"expireTime"`
|
||||
Remark *string `orm:"column(remark);size(1000);null" json:"remark"`
|
||||
LastHeartbeatAt *time.Time `orm:"column(last_heartbeat_at);type(datetime);null" json:"lastHeartbeatAt"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"createTime"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);auto_now;type(datetime);null" json:"updateTime"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"deleteTime"`
|
||||
}
|
||||
|
||||
func (m *PlatformCursorEquipment) TableName() string {
|
||||
return "yz_platform_cursor_equipment"
|
||||
}
|
||||
|
||||
+132
-132
@@ -1,132 +1,132 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// PlatformLoginVerify 平台登录验证配置(单行配置)
|
||||
type PlatformLoginVerify struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
OpenVerifyEnabled int8 `orm:"column(open_verify_enabled);default(1)" json:"openVerify_enabled"` // 0关闭 1开启
|
||||
VerifyType string `orm:"column(verify_type);size(20);default(captcha)" json:"verify_type"` // captcha/sms/geetest/email
|
||||
Geetest3ID *string `orm:"column(geetest3_id);size(128);null" json:"geetest3_id"`
|
||||
Geetest3Key *string `orm:"column(geetest3_key);size(255);null" json:"geetest3_key"`
|
||||
Geetest4ID *string `orm:"column(geetest4_id);size(128);null" json:"geetest4_id"`
|
||||
Geetest4Key *string `orm:"column(geetest4_key);size(255);null" json:"geetest4_key"`
|
||||
CreateTime time.Time `orm:"column(create_time);type(datetime);auto_now_add" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);auto_now;null" json:"update_time"`
|
||||
}
|
||||
|
||||
func GetPlatformLoginVerify() (*PlatformLoginVerify, error) {
|
||||
// 从 yz_platform_normal_setting 表中按 code 获取各个配置
|
||||
enabledStr := GetPlatformSettingValue("login_verify_enabled", "1")
|
||||
verifyType := GetPlatformSettingValue("login_verify_type", "captcha")
|
||||
geetest3ID := GetPlatformSettingValue("login_verify_geetest3_id", "")
|
||||
geetest3Key := GetPlatformSettingValue("login_verify_geetest3_key", "")
|
||||
geetest4ID := GetPlatformSettingValue("login_verify_geetest4_id", "")
|
||||
geetest4Key := GetPlatformSettingValue("login_verify_geetest4_key", "")
|
||||
|
||||
openVerifyEnabled := int8(1)
|
||||
if enabledStr == "0" {
|
||||
openVerifyEnabled = 0
|
||||
}
|
||||
|
||||
cfg := &PlatformLoginVerify{
|
||||
OpenVerifyEnabled: openVerifyEnabled,
|
||||
VerifyType: verifyType,
|
||||
}
|
||||
if geetest3ID != "" {
|
||||
cfg.Geetest3ID = &geetest3ID
|
||||
}
|
||||
if geetest3Key != "" {
|
||||
cfg.Geetest3Key = &geetest3Key
|
||||
}
|
||||
if geetest4ID != "" {
|
||||
cfg.Geetest4ID = &geetest4ID
|
||||
}
|
||||
if geetest4Key != "" {
|
||||
cfg.Geetest4Key = &geetest4Key
|
||||
}
|
||||
|
||||
return cfg, nil
|
||||
}
|
||||
|
||||
func GetPlatformSettingValue(code string, defaultVal string) string {
|
||||
var setting PlatformNormalSetting
|
||||
err := Orm.QueryTable(new(PlatformNormalSetting)).
|
||||
Filter("code", code).
|
||||
Filter("delete_time__isnull", true).
|
||||
One(&setting)
|
||||
if err != nil {
|
||||
return defaultVal
|
||||
}
|
||||
return setting.Value
|
||||
}
|
||||
|
||||
func SavePlatformLoginVerify(cfg *PlatformLoginVerify) error {
|
||||
openVerifyEnabledStr := "1"
|
||||
if cfg.OpenVerifyEnabled == 0 {
|
||||
openVerifyEnabledStr = "0"
|
||||
}
|
||||
geetest3ID := ""
|
||||
if cfg.Geetest3ID != nil {
|
||||
geetest3ID = *cfg.Geetest3ID
|
||||
}
|
||||
geetest3Key := ""
|
||||
if cfg.Geetest3Key != nil {
|
||||
geetest3Key = *cfg.Geetest3Key
|
||||
}
|
||||
geetest4ID := ""
|
||||
if cfg.Geetest4ID != nil {
|
||||
geetest4ID = *cfg.Geetest4ID
|
||||
}
|
||||
geetest4Key := ""
|
||||
if cfg.Geetest4Key != nil {
|
||||
geetest4Key = *cfg.Geetest4Key
|
||||
}
|
||||
|
||||
settings := []struct {
|
||||
code string
|
||||
name string
|
||||
value string
|
||||
remark string
|
||||
}{
|
||||
{"login_verify_enabled", "登录验证开启状态", openVerifyEnabledStr, "0为关闭,1为开启"},
|
||||
{"login_verify_type", "登录验证类型", cfg.VerifyType, "支持 captcha/sms/geetest/email"},
|
||||
{"login_verify_geetest3_id", "极验3 ID", geetest3ID, ""},
|
||||
{"login_verify_geetest3_key", "极验3 Key", geetest3Key, ""},
|
||||
{"login_verify_geetest4_id", "极验4 ID", geetest4ID, ""},
|
||||
{"login_verify_geetest4_key", "极验4 Key", geetest4Key, ""},
|
||||
}
|
||||
|
||||
for _, item := range settings {
|
||||
var setting PlatformNormalSetting
|
||||
err := Orm.QueryTable(new(PlatformNormalSetting)).
|
||||
Filter("code", item.code).
|
||||
Filter("delete_time__isnull", true).
|
||||
One(&setting)
|
||||
if err == nil {
|
||||
setting.Value = item.value
|
||||
setting.Name = item.name
|
||||
setting.Remark = item.remark
|
||||
now := time.Now()
|
||||
setting.UpdateTime = &now
|
||||
_, err = Orm.Update(&setting, "Value", "Name", "Remark", "UpdateTime")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
newSetting := PlatformNormalSetting{
|
||||
Name: item.name,
|
||||
Code: item.code,
|
||||
Value: item.value,
|
||||
Remark: item.remark,
|
||||
CreateTime: time.Now(),
|
||||
}
|
||||
_, err = Orm.Insert(&newSetting)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// PlatformLoginVerify 平台登录验证配置(单行配置)
|
||||
type PlatformLoginVerify struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
OpenVerifyEnabled int8 `orm:"column(open_verify_enabled);default(1)" json:"openVerify_enabled"` // 0关闭 1开启
|
||||
VerifyType string `orm:"column(verify_type);size(20);default(captcha)" json:"verify_type"` // captcha/sms/geetest/email
|
||||
Geetest3ID *string `orm:"column(geetest3_id);size(128);null" json:"geetest3_id"`
|
||||
Geetest3Key *string `orm:"column(geetest3_key);size(255);null" json:"geetest3_key"`
|
||||
Geetest4ID *string `orm:"column(geetest4_id);size(128);null" json:"geetest4_id"`
|
||||
Geetest4Key *string `orm:"column(geetest4_key);size(255);null" json:"geetest4_key"`
|
||||
CreateTime time.Time `orm:"column(create_time);type(datetime);auto_now_add" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);auto_now;null" json:"update_time"`
|
||||
}
|
||||
|
||||
func GetPlatformLoginVerify() (*PlatformLoginVerify, error) {
|
||||
// 从 yz_platform_normal_setting 表中按 code 获取各个配置
|
||||
enabledStr := GetPlatformSettingValue("login_verify_enabled", "1")
|
||||
verifyType := GetPlatformSettingValue("login_verify_type", "captcha")
|
||||
geetest3ID := GetPlatformSettingValue("login_verify_geetest3_id", "")
|
||||
geetest3Key := GetPlatformSettingValue("login_verify_geetest3_key", "")
|
||||
geetest4ID := GetPlatformSettingValue("login_verify_geetest4_id", "")
|
||||
geetest4Key := GetPlatformSettingValue("login_verify_geetest4_key", "")
|
||||
|
||||
openVerifyEnabled := int8(1)
|
||||
if enabledStr == "0" {
|
||||
openVerifyEnabled = 0
|
||||
}
|
||||
|
||||
cfg := &PlatformLoginVerify{
|
||||
OpenVerifyEnabled: openVerifyEnabled,
|
||||
VerifyType: verifyType,
|
||||
}
|
||||
if geetest3ID != "" {
|
||||
cfg.Geetest3ID = &geetest3ID
|
||||
}
|
||||
if geetest3Key != "" {
|
||||
cfg.Geetest3Key = &geetest3Key
|
||||
}
|
||||
if geetest4ID != "" {
|
||||
cfg.Geetest4ID = &geetest4ID
|
||||
}
|
||||
if geetest4Key != "" {
|
||||
cfg.Geetest4Key = &geetest4Key
|
||||
}
|
||||
|
||||
return cfg, nil
|
||||
}
|
||||
|
||||
func GetPlatformSettingValue(code string, defaultVal string) string {
|
||||
var setting PlatformNormalSetting
|
||||
err := Orm.QueryTable(new(PlatformNormalSetting)).
|
||||
Filter("code", code).
|
||||
Filter("delete_time__isnull", true).
|
||||
One(&setting)
|
||||
if err != nil {
|
||||
return defaultVal
|
||||
}
|
||||
return setting.Value
|
||||
}
|
||||
|
||||
func SavePlatformLoginVerify(cfg *PlatformLoginVerify) error {
|
||||
openVerifyEnabledStr := "1"
|
||||
if cfg.OpenVerifyEnabled == 0 {
|
||||
openVerifyEnabledStr = "0"
|
||||
}
|
||||
geetest3ID := ""
|
||||
if cfg.Geetest3ID != nil {
|
||||
geetest3ID = *cfg.Geetest3ID
|
||||
}
|
||||
geetest3Key := ""
|
||||
if cfg.Geetest3Key != nil {
|
||||
geetest3Key = *cfg.Geetest3Key
|
||||
}
|
||||
geetest4ID := ""
|
||||
if cfg.Geetest4ID != nil {
|
||||
geetest4ID = *cfg.Geetest4ID
|
||||
}
|
||||
geetest4Key := ""
|
||||
if cfg.Geetest4Key != nil {
|
||||
geetest4Key = *cfg.Geetest4Key
|
||||
}
|
||||
|
||||
settings := []struct {
|
||||
code string
|
||||
name string
|
||||
value string
|
||||
remark string
|
||||
}{
|
||||
{"login_verify_enabled", "登录验证开启状态", openVerifyEnabledStr, "0为关闭,1为开启"},
|
||||
{"login_verify_type", "登录验证类型", cfg.VerifyType, "支持 captcha/sms/geetest/email"},
|
||||
{"login_verify_geetest3_id", "极验3 ID", geetest3ID, ""},
|
||||
{"login_verify_geetest3_key", "极验3 Key", geetest3Key, ""},
|
||||
{"login_verify_geetest4_id", "极验4 ID", geetest4ID, ""},
|
||||
{"login_verify_geetest4_key", "极验4 Key", geetest4Key, ""},
|
||||
}
|
||||
|
||||
for _, item := range settings {
|
||||
var setting PlatformNormalSetting
|
||||
err := Orm.QueryTable(new(PlatformNormalSetting)).
|
||||
Filter("code", item.code).
|
||||
Filter("delete_time__isnull", true).
|
||||
One(&setting)
|
||||
if err == nil {
|
||||
setting.Value = item.value
|
||||
setting.Name = item.name
|
||||
setting.Remark = item.remark
|
||||
now := time.Now()
|
||||
setting.UpdateTime = &now
|
||||
_, err = Orm.Update(&setting, "Value", "Name", "Remark", "UpdateTime")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
newSetting := PlatformNormalSetting{
|
||||
Name: item.name,
|
||||
Code: item.code,
|
||||
Value: item.value,
|
||||
Remark: item.remark,
|
||||
CreateTime: time.Now(),
|
||||
}
|
||||
_, err = Orm.Insert(&newSetting)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// PlatformNotebook 平台记事本表: yz_platform_notebook
|
||||
type PlatformNotebook struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Title string `orm:"column(title);size(255)" json:"title"`
|
||||
Content string `orm:"column(content);type(longtext);null" json:"content"`
|
||||
UserID *uint64 `orm:"column(user_id);null" json:"user_id"`
|
||||
UserName *string `orm:"column(user_name);size(100);null" json:"user_name"`
|
||||
IsDeleted int8 `orm:"column(is_deleted);default(0)" json:"is_deleted"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *PlatformNotebook) TableName() string {
|
||||
return "yz_platform_notebook"
|
||||
}
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// PlatformNotebook 平台记事本表: yz_platform_notebook
|
||||
type PlatformNotebook struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Title string `orm:"column(title);size(255)" json:"title"`
|
||||
Content string `orm:"column(content);type(longtext);null" json:"content"`
|
||||
UserID *uint64 `orm:"column(user_id);null" json:"user_id"`
|
||||
UserName *string `orm:"column(user_name);size(100);null" json:"user_name"`
|
||||
IsDeleted int8 `orm:"column(is_deleted);default(0)" json:"is_deleted"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *PlatformNotebook) TableName() string {
|
||||
return "yz_platform_notebook"
|
||||
}
|
||||
|
||||
@@ -1,55 +1,55 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// PlatformSchedule 日程主表: yz_platform_schedule
|
||||
type PlatformSchedule struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Title string `orm:"column(title);size(255)" json:"title"`
|
||||
Content string `orm:"column(content);type(text)" json:"content"`
|
||||
ScheduleTime time.Time `orm:"column(schedule_time);type(datetime)" json:"schedule_time"`
|
||||
UserID uint64 `orm:"column(user_id)" json:"user_id"`
|
||||
}
|
||||
|
||||
func (m *PlatformSchedule) TableName() string {
|
||||
return "yz_platform_schedule"
|
||||
}
|
||||
|
||||
// PlatformScheduleReminder 日程提醒主表: yz_platform_schedule_reminder
|
||||
type PlatformScheduleReminder struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
ScheduleID uint64 `orm:"column(schedule_id)" json:"schedule_id"`
|
||||
RemindChannel string `orm:"column(remind_channel);size(20)" json:"remind_channel"` // SMS/EMAIL/BARK/SITE_MSG
|
||||
AdvanceMinutes int `orm:"column(advance_minutes);default(0)" json:"advance_minutes"`
|
||||
RepeatIntervalMinutes int `orm:"column(repeat_interval_minutes);default(0)" json:"repeat_interval_minutes"`
|
||||
NextRemindTime time.Time `orm:"column(next_remind_time);type(datetime)" json:"next_remind_time"`
|
||||
SendCount int `orm:"column(send_count);default(0)" json:"send_count"`
|
||||
MaxSendCount int `orm:"column(max_send_count);default(1)" json:"max_send_count"`
|
||||
AckToken *string `orm:"column(ack_token);size(64);null" json:"ack_token"`
|
||||
AckStatus int8 `orm:"column(ack_status);default(0)" json:"ack_status"` // 0-未确认 1-已确认
|
||||
AckTime *time.Time `orm:"column(ack_time);type(datetime);null" json:"ack_time"`
|
||||
ReceiverUserID uint64 `orm:"column(receiver_user_id)" json:"receiver_user_id"`
|
||||
ReceiverTarget *string `orm:"column(receiver_target);size(255);null" json:"receiver_target"`
|
||||
RemindStatus int8 `orm:"column(remind_status);default(0)" json:"remind_status"` // 0-待提醒 1-提醒中 2-已结束
|
||||
ScanLock string `orm:"column(scan_lock);size(64);default('')" json:"scan_lock"`
|
||||
IsDeleted int8 `orm:"column(is_deleted);default(0)" json:"is_deleted"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
||||
UpdateTime time.Time `orm:"column(update_time);auto_now;type(datetime)" json:"update_time"`
|
||||
}
|
||||
|
||||
func (m *PlatformScheduleReminder) TableName() string {
|
||||
return "yz_platform_schedule_reminder"
|
||||
}
|
||||
|
||||
// PlatformScheduleReminderSendLog 提醒实际发送流水: yz_platform_schedule_reminder_send_log
|
||||
type PlatformScheduleReminderSendLog struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
ReminderID uint64 `orm:"column(reminder_id)" json:"reminder_id"`
|
||||
SendTime time.Time `orm:"column(send_time);type(datetime)" json:"send_time"`
|
||||
SendResult int8 `orm:"column(send_result)" json:"send_result"` // 0-失败 1-成功
|
||||
FailReason *string `orm:"column(fail_reason);size(255);null" json:"fail_reason"`
|
||||
}
|
||||
|
||||
func (m *PlatformScheduleReminderSendLog) TableName() string {
|
||||
return "yz_platform_schedule_reminder_send_log"
|
||||
}
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// PlatformSchedule 日程主表: yz_platform_schedule
|
||||
type PlatformSchedule struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Title string `orm:"column(title);size(255)" json:"title"`
|
||||
Content string `orm:"column(content);type(text)" json:"content"`
|
||||
ScheduleTime time.Time `orm:"column(schedule_time);type(datetime)" json:"schedule_time"`
|
||||
UserID uint64 `orm:"column(user_id)" json:"user_id"`
|
||||
}
|
||||
|
||||
func (m *PlatformSchedule) TableName() string {
|
||||
return "yz_platform_schedule"
|
||||
}
|
||||
|
||||
// PlatformScheduleReminder 日程提醒主表: yz_platform_schedule_reminder
|
||||
type PlatformScheduleReminder struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
ScheduleID uint64 `orm:"column(schedule_id)" json:"schedule_id"`
|
||||
RemindChannel string `orm:"column(remind_channel);size(20)" json:"remind_channel"` // SMS/EMAIL/BARK/SITE_MSG
|
||||
AdvanceMinutes int `orm:"column(advance_minutes);default(0)" json:"advance_minutes"`
|
||||
RepeatIntervalMinutes int `orm:"column(repeat_interval_minutes);default(0)" json:"repeat_interval_minutes"`
|
||||
NextRemindTime time.Time `orm:"column(next_remind_time);type(datetime)" json:"next_remind_time"`
|
||||
SendCount int `orm:"column(send_count);default(0)" json:"send_count"`
|
||||
MaxSendCount int `orm:"column(max_send_count);default(1)" json:"max_send_count"`
|
||||
AckToken *string `orm:"column(ack_token);size(64);null" json:"ack_token"`
|
||||
AckStatus int8 `orm:"column(ack_status);default(0)" json:"ack_status"` // 0-未确认 1-已确认
|
||||
AckTime *time.Time `orm:"column(ack_time);type(datetime);null" json:"ack_time"`
|
||||
ReceiverUserID uint64 `orm:"column(receiver_user_id)" json:"receiver_user_id"`
|
||||
ReceiverTarget *string `orm:"column(receiver_target);size(255);null" json:"receiver_target"`
|
||||
RemindStatus int8 `orm:"column(remind_status);default(0)" json:"remind_status"` // 0-待提醒 1-提醒中 2-已结束
|
||||
ScanLock string `orm:"column(scan_lock);size(64);default('')" json:"scan_lock"`
|
||||
IsDeleted int8 `orm:"column(is_deleted);default(0)" json:"is_deleted"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
||||
UpdateTime time.Time `orm:"column(update_time);auto_now;type(datetime)" json:"update_time"`
|
||||
}
|
||||
|
||||
func (m *PlatformScheduleReminder) TableName() string {
|
||||
return "yz_platform_schedule_reminder"
|
||||
}
|
||||
|
||||
// PlatformScheduleReminderSendLog 提醒实际发送流水: yz_platform_schedule_reminder_send_log
|
||||
type PlatformScheduleReminderSendLog struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
ReminderID uint64 `orm:"column(reminder_id)" json:"reminder_id"`
|
||||
SendTime time.Time `orm:"column(send_time);type(datetime)" json:"send_time"`
|
||||
SendResult int8 `orm:"column(send_result)" json:"send_result"` // 0-失败 1-成功
|
||||
FailReason *string `orm:"column(fail_reason);size(255);null" json:"fail_reason"`
|
||||
}
|
||||
|
||||
func (m *PlatformScheduleReminderSendLog) TableName() string {
|
||||
return "yz_platform_schedule_reminder_send_log"
|
||||
}
|
||||
|
||||
+35
-35
@@ -1,35 +1,35 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// StorageConfig 存储配置(单行配置)
|
||||
type StorageConfig struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
StorageType string `orm:"column(storage_type);size(20);default(local)" json:"storage_type"` // local/qiniu
|
||||
// 七牛云配置
|
||||
QiniuAccessKey string `orm:"column(qiniu_access_key);size(255);null" json:"qiniu_access_key"`
|
||||
QiniuSecretKey string `orm:"column(qiniu_secret_key);size(255);null" json:"qiniu_secret_key"`
|
||||
QiniuBucket string `orm:"column(qiniu_bucket);size(128);null" json:"qiniu_bucket"`
|
||||
QiniuDomain string `orm:"column(qiniu_domain);size(255);null" json:"qiniu_domain"` // CDN域名
|
||||
QiniuRegion string `orm:"column(qiniu_region);size(50);null" json:"qiniu_region"` // 存储区域
|
||||
CreateTime time.Time `orm:"column(create_time);type(datetime);auto_now_add" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);auto_now;null" json:"update_time"`
|
||||
}
|
||||
|
||||
func (m *StorageConfig) TableName() string {
|
||||
return "yz_system_storage_config"
|
||||
}
|
||||
|
||||
// GetStorageConfig 获取存储配置
|
||||
func GetStorageConfig() (*StorageConfig, error) {
|
||||
var cfg StorageConfig
|
||||
err := Orm.QueryTable(new(StorageConfig)).OrderBy("-id").One(&cfg)
|
||||
if err != nil {
|
||||
// 默认配置:本地存储
|
||||
return &StorageConfig{StorageType: "local"}, nil
|
||||
}
|
||||
if cfg.StorageType == "" {
|
||||
cfg.StorageType = "local"
|
||||
}
|
||||
return &cfg, nil
|
||||
}
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// StorageConfig 存储配置(单行配置)
|
||||
type StorageConfig struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
StorageType string `orm:"column(storage_type);size(20);default(local)" json:"storage_type"` // local/qiniu
|
||||
// 七牛云配置
|
||||
QiniuAccessKey string `orm:"column(qiniu_access_key);size(255);null" json:"qiniu_access_key"`
|
||||
QiniuSecretKey string `orm:"column(qiniu_secret_key);size(255);null" json:"qiniu_secret_key"`
|
||||
QiniuBucket string `orm:"column(qiniu_bucket);size(128);null" json:"qiniu_bucket"`
|
||||
QiniuDomain string `orm:"column(qiniu_domain);size(255);null" json:"qiniu_domain"` // CDN域名
|
||||
QiniuRegion string `orm:"column(qiniu_region);size(50);null" json:"qiniu_region"` // 存储区域
|
||||
CreateTime time.Time `orm:"column(create_time);type(datetime);auto_now_add" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);auto_now;null" json:"update_time"`
|
||||
}
|
||||
|
||||
func (m *StorageConfig) TableName() string {
|
||||
return "yz_system_storage_config"
|
||||
}
|
||||
|
||||
// GetStorageConfig 获取存储配置
|
||||
func GetStorageConfig() (*StorageConfig, error) {
|
||||
var cfg StorageConfig
|
||||
err := Orm.QueryTable(new(StorageConfig)).OrderBy("-id").One(&cfg)
|
||||
if err != nil {
|
||||
// 默认配置:本地存储
|
||||
return &StorageConfig{StorageType: "local"}, nil
|
||||
}
|
||||
if cfg.StorageType == "" {
|
||||
cfg.StorageType = "local"
|
||||
}
|
||||
return &cfg, nil
|
||||
}
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// SystemDomainPool 主域名池表 yz_system_domain_pool
|
||||
type SystemDomainPool struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
MainDomain string `orm:"column(main_domain);size(255)" json:"main_domain"`
|
||||
Status int8 `orm:"column(status);default(1)" json:"status"` // 1启用 0禁用
|
||||
CreateTime time.Time `orm:"column(create_time);type(datetime);auto_now_add" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);auto_now;null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *SystemDomainPool) TableName() string {
|
||||
return "yz_system_domain_pool"
|
||||
}
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// SystemDomainPool 主域名池表 yz_system_domain_pool
|
||||
type SystemDomainPool struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
MainDomain string `orm:"column(main_domain);size(255)" json:"main_domain"`
|
||||
Status int8 `orm:"column(status);default(1)" json:"status"` // 1启用 0禁用
|
||||
CreateTime time.Time `orm:"column(create_time);type(datetime);auto_now_add" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);auto_now;null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *SystemDomainPool) TableName() string {
|
||||
return "yz_system_domain_pool"
|
||||
}
|
||||
|
||||
+21
-21
@@ -1,21 +1,21 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// SystemEmail 系统邮箱配置表 yz_system_email
|
||||
type SystemEmail struct {
|
||||
ID uint `orm:"column(id);pk;auto" json:"id"`
|
||||
FromAddress string `orm:"column(from_address);size(191)" json:"from_address"`
|
||||
FromName *string `orm:"column(from_name);size(191);null" json:"from_name"`
|
||||
Host string `orm:"column(host);size(191)" json:"host"`
|
||||
Port uint `orm:"column(port);default(465)" json:"port"`
|
||||
Password string `orm:"column(password);size(255)" json:"password"`
|
||||
Encryption string `orm:"column(encryption);size(8)" json:"encryption"` // ssl / tls / none
|
||||
Timeout uint `orm:"column(timeout);default(30)" json:"timeout"`
|
||||
Status int8 `orm:"column(status);default(1)" json:"status"`
|
||||
Remark *string `orm:"column(remark);size(255);null" json:"remark"`
|
||||
CreateTime time.Time `orm:"column(create_time);type(datetime);auto_now_add;null" json:"create_time"`
|
||||
UpdateTime time.Time `orm:"column(update_time);type(datetime);auto_now;null" json:"update_time"`
|
||||
}
|
||||
|
||||
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// SystemEmail 系统邮箱配置表 yz_system_email
|
||||
type SystemEmail struct {
|
||||
ID uint `orm:"column(id);pk;auto" json:"id"`
|
||||
FromAddress string `orm:"column(from_address);size(191)" json:"from_address"`
|
||||
FromName *string `orm:"column(from_name);size(191);null" json:"from_name"`
|
||||
Host string `orm:"column(host);size(191)" json:"host"`
|
||||
Port uint `orm:"column(port);default(465)" json:"port"`
|
||||
Password string `orm:"column(password);size(255)" json:"password"`
|
||||
Encryption string `orm:"column(encryption);size(8)" json:"encryption"` // ssl / tls / none
|
||||
Timeout uint `orm:"column(timeout);default(30)" json:"timeout"`
|
||||
Status int8 `orm:"column(status);default(1)" json:"status"`
|
||||
Remark *string `orm:"column(remark);size(255);null" json:"remark"`
|
||||
CreateTime time.Time `orm:"column(create_time);type(datetime);auto_now_add;null" json:"create_time"`
|
||||
UpdateTime time.Time `orm:"column(update_time);type(datetime);auto_now;null" json:"update_time"`
|
||||
}
|
||||
|
||||
|
||||
|
||||
+25
-25
@@ -1,25 +1,25 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// SystemFile 附件表 yz_system_files
|
||||
type SystemFile struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Tid uint64 `orm:"column(tid)" json:"tid"`
|
||||
Uid *uint64 `orm:"column(uid);null" json:"uid"`
|
||||
Tuid *uint64 `orm:"column(tuid);null" json:"tuid"`
|
||||
Name string `orm:"column(name);size(255)" json:"name"`
|
||||
Type uint8 `orm:"column(type);default(2)" json:"type"`
|
||||
Cate uint64 `orm:"column(cate);default(0)" json:"cate"`
|
||||
Size uint64 `orm:"column(size);default(0)" json:"size"`
|
||||
Src string `orm:"column(src);size(512)" json:"src"`
|
||||
Uploader uint64 `orm:"column(uploader);default(0)" json:"uploader"`
|
||||
Md5 string `orm:"column(md5);size(32)" json:"md5"`
|
||||
CreateTime time.Time `orm:"column(create_time);type(datetime);auto_now_add" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);null;auto_now" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *SystemFile) TableName() string {
|
||||
return "yz_system_files"
|
||||
}
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// SystemFile 附件表 yz_system_files
|
||||
type SystemFile struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Tid uint64 `orm:"column(tid)" json:"tid"`
|
||||
Uid *uint64 `orm:"column(uid);null" json:"uid"`
|
||||
Tuid *uint64 `orm:"column(tuid);null" json:"tuid"`
|
||||
Name string `orm:"column(name);size(255)" json:"name"`
|
||||
Type uint8 `orm:"column(type);default(2)" json:"type"`
|
||||
Cate uint64 `orm:"column(cate);default(0)" json:"cate"`
|
||||
Size uint64 `orm:"column(size);default(0)" json:"size"`
|
||||
Src string `orm:"column(src);size(512)" json:"src"`
|
||||
Uploader uint64 `orm:"column(uploader);default(0)" json:"uploader"`
|
||||
Md5 string `orm:"column(md5);size(32)" json:"md5"`
|
||||
CreateTime time.Time `orm:"column(create_time);type(datetime);auto_now_add" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);null;auto_now" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *SystemFile) TableName() string {
|
||||
return "yz_system_files"
|
||||
}
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// SystemFilesCategory 文件分类表 yz_system_files_category
|
||||
type SystemFilesCategory struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Tid uint64 `orm:"column(tid)" json:"tid"`
|
||||
Uid *uint64 `orm:"column(uid);null" json:"uid"`
|
||||
Tuid *uint64 `orm:"column(tuid);null" json:"tuid"`
|
||||
Name string `orm:"column(name);size(128)" json:"name"`
|
||||
CreateTime time.Time `orm:"column(create_time);type(datetime);auto_now_add" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);null;auto_now" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *SystemFilesCategory) TableName() string {
|
||||
return "yz_system_files_category"
|
||||
}
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// SystemFilesCategory 文件分类表 yz_system_files_category
|
||||
type SystemFilesCategory struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Tid uint64 `orm:"column(tid)" json:"tid"`
|
||||
Uid *uint64 `orm:"column(uid);null" json:"uid"`
|
||||
Tuid *uint64 `orm:"column(tuid);null" json:"tuid"`
|
||||
Name string `orm:"column(name);size(128)" json:"name"`
|
||||
CreateTime time.Time `orm:"column(create_time);type(datetime);auto_now_add" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);null;auto_now" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *SystemFilesCategory) TableName() string {
|
||||
return "yz_system_files_category"
|
||||
}
|
||||
|
||||
+30
-30
@@ -1,30 +1,30 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// SystemMenu 系统菜单表 yz_system_menu
|
||||
type SystemMenu struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"` // 菜单ID
|
||||
Pid int64 `orm:"column(pid);default(0)" json:"pid"` // 上级菜单ID
|
||||
Title string `orm:"column(title);size(50)" json:"title"` // 菜单名称
|
||||
Path *string `orm:"column(path);size(200);null" json:"path"` // 路由路径
|
||||
ComponentPath *string `orm:"column(component_path);size(255);null" json:"componentPath"` // 组件路径
|
||||
Icon *string `orm:"column(icon);size(100);null" json:"icon"` // 菜单图标
|
||||
Sort int64 `orm:"column(sort);default(0)" json:"sort"` // 排序号
|
||||
Status int8 `orm:"column(status);default(0)" json:"status"` // 状态:1-启用,0-禁用
|
||||
IsVisible *int8 `orm:"column(is_visible);null" json:"isVisible"` // 是否显示:1-显示 0-不显示
|
||||
Views *string `orm:"column(views);size(255);null" json:"views"` // 菜单显示端(JSON数组字符串):[1]=平台端 [2]=租户端 [1,2]=双端
|
||||
Type int8 `orm:"column(type)" json:"type"` // 菜单类型:1-目录,2-页面,3-接口
|
||||
Permission *string `orm:"column(permission);size(100);null" json:"permission"` // 权限标识(按钮类型时填写)
|
||||
Creater *string `orm:"column(creater);size(50);null" json:"creater"` // 创建者
|
||||
Remark *string `orm:"column(remark);size(500);null" json:"remark"` // 备注
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"createTime"` // 创建时间
|
||||
UpdateTime *time.Time `orm:"column(update_time);auto_now;type(datetime);null" json:"updateTime"` // 更新时间
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"deleteTime"` // 删除时间
|
||||
}
|
||||
|
||||
// TableName 自定义表名
|
||||
func (m *SystemMenu) TableName() string {
|
||||
return "yz_system_menu"
|
||||
}
|
||||
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// SystemMenu 系统菜单表 yz_system_menu
|
||||
type SystemMenu struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"` // 菜单ID
|
||||
Pid int64 `orm:"column(pid);default(0)" json:"pid"` // 上级菜单ID
|
||||
Title string `orm:"column(title);size(50)" json:"title"` // 菜单名称
|
||||
Path *string `orm:"column(path);size(200);null" json:"path"` // 路由路径
|
||||
ComponentPath *string `orm:"column(component_path);size(255);null" json:"componentPath"` // 组件路径
|
||||
Icon *string `orm:"column(icon);size(100);null" json:"icon"` // 菜单图标
|
||||
Sort int64 `orm:"column(sort);default(0)" json:"sort"` // 排序号
|
||||
Status int8 `orm:"column(status);default(0)" json:"status"` // 状态:1-启用,0-禁用
|
||||
IsVisible *int8 `orm:"column(is_visible);null" json:"isVisible"` // 是否显示:1-显示 0-不显示
|
||||
Views *string `orm:"column(views);size(255);null" json:"views"` // 菜单显示端(JSON数组字符串):[1]=平台端 [2]=租户端 [1,2]=双端
|
||||
Type int8 `orm:"column(type)" json:"type"` // 菜单类型:1-目录,2-页面,3-接口
|
||||
Permission *string `orm:"column(permission);size(100);null" json:"permission"` // 权限标识(按钮类型时填写)
|
||||
Creater *string `orm:"column(creater);size(50);null" json:"creater"` // 创建者
|
||||
Remark *string `orm:"column(remark);size(500);null" json:"remark"` // 备注
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"createTime"` // 创建时间
|
||||
UpdateTime *time.Time `orm:"column(update_time);auto_now;type(datetime);null" json:"updateTime"` // 更新时间
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"deleteTime"` // 删除时间
|
||||
}
|
||||
|
||||
// TableName 自定义表名
|
||||
func (m *SystemMenu) TableName() string {
|
||||
return "yz_system_menu"
|
||||
}
|
||||
|
||||
|
||||
+25
-25
@@ -1,25 +1,25 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// SystemModules 系统模块表 yz_system_modules
|
||||
type SystemModules struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Mid *uint64 `orm:"column(mid);null" json:"mid"`
|
||||
Name string `orm:"column(name);size(50)" json:"name"`
|
||||
Code string `orm:"column(code);size(50)" json:"code"`
|
||||
Path string `orm:"column(path);size(100)" json:"path"`
|
||||
Icon string `orm:"column(icon);size(50)" json:"icon"`
|
||||
Description string `orm:"column(description);size(255)" json:"description"`
|
||||
Type int `orm:"column(type);default(0)" json:"type"` // 0未分类 1功能模块 2系统配置
|
||||
Sort int `orm:"column(sort);default(0)" json:"sort"`
|
||||
Status int8 `orm:"column(status);default(1)" json:"status"` // 0禁用 1启用
|
||||
IsShow int8 `orm:"column(is_show);default(1)" json:"is_show"` // 0否 1是
|
||||
CreateTime *time.Time `orm:"column(create_time);type(datetime);null" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *SystemModules) TableName() string {
|
||||
return "yz_system_modules"
|
||||
}
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// SystemModules 系统模块表 yz_system_modules
|
||||
type SystemModules struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Mid *uint64 `orm:"column(mid);null" json:"mid"`
|
||||
Name string `orm:"column(name);size(50)" json:"name"`
|
||||
Code string `orm:"column(code);size(50)" json:"code"`
|
||||
Path string `orm:"column(path);size(100)" json:"path"`
|
||||
Icon string `orm:"column(icon);size(50)" json:"icon"`
|
||||
Description string `orm:"column(description);size(255)" json:"description"`
|
||||
Type int `orm:"column(type);default(0)" json:"type"` // 0未分类 1功能模块 2系统配置
|
||||
Sort int `orm:"column(sort);default(0)" json:"sort"`
|
||||
Status int8 `orm:"column(status);default(1)" json:"status"` // 0禁用 1启用
|
||||
IsShow int8 `orm:"column(is_show);default(1)" json:"is_show"` // 0否 1是
|
||||
CreateTime *time.Time `orm:"column(create_time);type(datetime);null" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *SystemModules) TableName() string {
|
||||
return "yz_system_modules"
|
||||
}
|
||||
|
||||
@@ -1,51 +1,51 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// SystemNormalSetting 系统通用配置表: yz_system_normal_setting
|
||||
type SystemNormalSetting struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Name string `orm:"column(name);size(128);default('')" json:"name"`
|
||||
Value string `orm:"column(value);type(text);null" json:"value"`
|
||||
Code string `orm:"column(code);size(64);default('')" json:"code"`
|
||||
Remark string `orm:"column(remark);size(255);default('')" json:"remark"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *SystemNormalSetting) TableName() string {
|
||||
return "yz_system_normal_setting"
|
||||
}
|
||||
|
||||
// PlatformNormalSetting 平台通用配置表: yz_platform_normal_setting
|
||||
type PlatformNormalSetting struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Name string `orm:"column(name);size(128);default('')" json:"name"`
|
||||
Value string `orm:"column(value);type(text);null" json:"value"`
|
||||
Code string `orm:"column(code);size(64);default('')" json:"code"`
|
||||
Remark string `orm:"column(remark);size(255);default('')" json:"remark"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *PlatformNormalSetting) TableName() string {
|
||||
return "yz_platform_normal_setting"
|
||||
}
|
||||
|
||||
// BackendNormalSetting 管理端通用配置表: yz_backend_normal_setting
|
||||
type BackendNormalSetting struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Name string `orm:"column(name);size(128);default('')" json:"name"`
|
||||
Value string `orm:"column(value);type(text);null" json:"value"`
|
||||
Code string `orm:"column(code);size(64);default('')" json:"code"`
|
||||
Remark string `orm:"column(remark);size(255);default('')" json:"remark"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *BackendNormalSetting) TableName() string {
|
||||
return "yz_backend_normal_setting"
|
||||
}
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// SystemNormalSetting 系统通用配置表: yz_system_normal_setting
|
||||
type SystemNormalSetting struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Name string `orm:"column(name);size(128);default('')" json:"name"`
|
||||
Value string `orm:"column(value);type(text);null" json:"value"`
|
||||
Code string `orm:"column(code);size(64);default('')" json:"code"`
|
||||
Remark string `orm:"column(remark);size(255);default('')" json:"remark"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *SystemNormalSetting) TableName() string {
|
||||
return "yz_system_normal_setting"
|
||||
}
|
||||
|
||||
// PlatformNormalSetting 平台通用配置表: yz_platform_normal_setting
|
||||
type PlatformNormalSetting struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Name string `orm:"column(name);size(128);default('')" json:"name"`
|
||||
Value string `orm:"column(value);type(text);null" json:"value"`
|
||||
Code string `orm:"column(code);size(64);default('')" json:"code"`
|
||||
Remark string `orm:"column(remark);size(255);default('')" json:"remark"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *PlatformNormalSetting) TableName() string {
|
||||
return "yz_platform_normal_setting"
|
||||
}
|
||||
|
||||
// BackendNormalSetting 管理端通用配置表: yz_backend_normal_setting
|
||||
type BackendNormalSetting struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Name string `orm:"column(name);size(128);default('')" json:"name"`
|
||||
Value string `orm:"column(value);type(text);null" json:"value"`
|
||||
Code string `orm:"column(code);size(64);default('')" json:"code"`
|
||||
Remark string `orm:"column(remark);size(255);default('')" json:"remark"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *BackendNormalSetting) TableName() string {
|
||||
return "yz_backend_normal_setting"
|
||||
}
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// SystemOperationLog 操作日志表 yz_system_operation_log
|
||||
type SystemOperationLog struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Tid *uint64 `orm:"column(tid);null" json:"tid"`
|
||||
UserID uint64 `orm:"column(user_id);default(0)" json:"user_id"`
|
||||
Module string `orm:"column(module);size(50);default('')" json:"module"`
|
||||
Action string `orm:"column(action);size(50);default('')" json:"action"`
|
||||
Method string `orm:"column(method);size(10);default('')" json:"method"`
|
||||
URL string `orm:"column(url);size(255);default('')" json:"url"`
|
||||
IP string `orm:"column(ip);size(50);default('')" json:"ip"`
|
||||
UserAgent string `orm:"column(user_agent);size(500);default('')" json:"user_agent"`
|
||||
RequestData *string `orm:"column(request_data);type(text);null" json:"request_data"`
|
||||
ResponseData *string `orm:"column(response_data);type(text);null" json:"response_data"`
|
||||
Status int8 `orm:"column(status);default(1)" json:"status"`
|
||||
ErrorMessage *string `orm:"column(error_message);type(text);null" json:"error_message"`
|
||||
ExecutionTime float64 `orm:"column(execution_time);digits(10);decimals(3);default(0)" json:"execution_time"`
|
||||
CreateTime time.Time `orm:"column(create_time);type(datetime);auto_now_add" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);auto_now;null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *SystemOperationLog) TableName() string {
|
||||
return "yz_system_operation_log"
|
||||
}
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// SystemOperationLog 操作日志表 yz_system_operation_log
|
||||
type SystemOperationLog struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Tid *uint64 `orm:"column(tid);null" json:"tid"`
|
||||
UserID uint64 `orm:"column(user_id);default(0)" json:"user_id"`
|
||||
Module string `orm:"column(module);size(50);default('')" json:"module"`
|
||||
Action string `orm:"column(action);size(50);default('')" json:"action"`
|
||||
Method string `orm:"column(method);size(10);default('')" json:"method"`
|
||||
URL string `orm:"column(url);size(255);default('')" json:"url"`
|
||||
IP string `orm:"column(ip);size(50);default('')" json:"ip"`
|
||||
UserAgent string `orm:"column(user_agent);size(500);default('')" json:"user_agent"`
|
||||
RequestData *string `orm:"column(request_data);type(text);null" json:"request_data"`
|
||||
ResponseData *string `orm:"column(response_data);type(text);null" json:"response_data"`
|
||||
Status int8 `orm:"column(status);default(1)" json:"status"`
|
||||
ErrorMessage *string `orm:"column(error_message);type(text);null" json:"error_message"`
|
||||
ExecutionTime float64 `orm:"column(execution_time);digits(10);decimals(3);default(0)" json:"execution_time"`
|
||||
CreateTime time.Time `orm:"column(create_time);type(datetime);auto_now_add" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);auto_now;null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *SystemOperationLog) TableName() string {
|
||||
return "yz_system_operation_log"
|
||||
}
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// SystemReminderList 站内信消息列表表 yz_system_reminderlist
|
||||
type SystemReminderList struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Title string `orm:"column(title);size(255)" json:"title"`
|
||||
Content string `orm:"column(content);type(text)" json:"content"`
|
||||
SenderID uint64 `orm:"column(sender_id);default(0)" json:"sender_id"`
|
||||
SenderType string `orm:"column(sender_type);size(32);default('system')" json:"sender_type"` // system, platform, tenant
|
||||
ReceiverID uint64 `orm:"column(receiver_id)" json:"receiver_id"`
|
||||
ReceiverType string `orm:"column(receiver_type);size(32)" json:"receiver_type"` // platform, tenant
|
||||
IsRead int8 `orm:"column(is_read);default(0)" json:"is_read"` // 0-未读, 1-已读
|
||||
ReadTime *time.Time `orm:"column(read_time);type(datetime);null" json:"read_time"`
|
||||
CreateTime *time.Time `orm:"column(create_time);type(datetime);null" json:"create_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
BatchID string `orm:"column(batch_id);size(64);default('')" json:"batch_id"`
|
||||
TargetType string `orm:"column(target_type);size(32);default('')" json:"target_type"`
|
||||
TargetRoleID uint64 `orm:"column(target_role_id);default(0)" json:"target_role_id"`
|
||||
TargetTenantID uint64 `orm:"column(target_tenant_id);default(0)" json:"target_tenant_id"`
|
||||
}
|
||||
|
||||
func (m *SystemReminderList) TableName() string {
|
||||
return "yz_system_reminderlist"
|
||||
}
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// SystemReminderList 站内信消息列表表 yz_system_reminderlist
|
||||
type SystemReminderList struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Title string `orm:"column(title);size(255)" json:"title"`
|
||||
Content string `orm:"column(content);type(text)" json:"content"`
|
||||
SenderID uint64 `orm:"column(sender_id);default(0)" json:"sender_id"`
|
||||
SenderType string `orm:"column(sender_type);size(32);default('system')" json:"sender_type"` // system, platform, tenant
|
||||
ReceiverID uint64 `orm:"column(receiver_id)" json:"receiver_id"`
|
||||
ReceiverType string `orm:"column(receiver_type);size(32)" json:"receiver_type"` // platform, tenant
|
||||
IsRead int8 `orm:"column(is_read);default(0)" json:"is_read"` // 0-未读, 1-已读
|
||||
ReadTime *time.Time `orm:"column(read_time);type(datetime);null" json:"read_time"`
|
||||
CreateTime *time.Time `orm:"column(create_time);type(datetime);null" json:"create_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
BatchID string `orm:"column(batch_id);size(64);default('')" json:"batch_id"`
|
||||
TargetType string `orm:"column(target_type);size(32);default('')" json:"target_type"`
|
||||
TargetRoleID uint64 `orm:"column(target_role_id);default(0)" json:"target_role_id"`
|
||||
TargetTenantID uint64 `orm:"column(target_tenant_id);default(0)" json:"target_tenant_id"`
|
||||
}
|
||||
|
||||
func (m *SystemReminderList) TableName() string {
|
||||
return "yz_system_reminderlist"
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// SystemSiteReminder 站内信配置表 yz_system_sitereminder
|
||||
type SystemSiteReminder struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
RetentionDays int `orm:"column(retention_days);default(30)" json:"retention_days"`
|
||||
AutoRead int8 `orm:"column(auto_read);default(0)" json:"auto_read"`
|
||||
CreateTime *time.Time `orm:"column(create_time);type(datetime);null" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);null" json:"update_time"`
|
||||
}
|
||||
|
||||
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// SystemSiteReminder 站内信配置表 yz_system_sitereminder
|
||||
type SystemSiteReminder struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
RetentionDays int `orm:"column(retention_days);default(30)" json:"retention_days"`
|
||||
AutoRead int8 `orm:"column(auto_read);default(0)" json:"auto_read"`
|
||||
CreateTime *time.Time `orm:"column(create_time);type(datetime);null" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);null" json:"update_time"`
|
||||
}
|
||||
|
||||
|
||||
|
||||
+30
-30
@@ -1,30 +1,30 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// SystemSMS 短信配置表 yz_system_sms
|
||||
type SystemSMS struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
ConfigCode string `orm:"column(config_code);size(64)" json:"config_code"`
|
||||
ConfigName string `orm:"column(config_name);size(128)" json:"config_name"`
|
||||
ChannelType int8 `orm:"column(channel_type);default(1)" json:"channel_type"`
|
||||
|
||||
ApiURL string `orm:"column(api_url);size(512);default('')" json:"api_url"`
|
||||
ApiKey string `orm:"column(api_key);size(256);default('')" json:"api_key"`
|
||||
ApiSecret string `orm:"column(api_secret);size(256);default('')" json:"api_secret"`
|
||||
|
||||
SignName string `orm:"column(sign_name);size(128);default('')" json:"sign_name"`
|
||||
TemplateID string `orm:"column(template_id);size(128);default('')" json:"template_id"`
|
||||
ExtraParams *string `orm:"column(extra_params);type(json);null" json:"extra_params"`
|
||||
|
||||
TestPhone string `orm:"column(test_phone);size(64);default('')" json:"test_phone"`
|
||||
|
||||
Weight int `orm:"column(weight);default(10)" json:"weight"`
|
||||
IsDefault int8 `orm:"column(is_default);default(0)" json:"is_default"`
|
||||
Status int8 `orm:"column(status);default(1)" json:"status"`
|
||||
Remark string `orm:"column(remark);size(512);default('')" json:"remark"`
|
||||
CreateTime time.Time `orm:"column(create_time);type(datetime);auto_now_add" json:"create_time"`
|
||||
UpdateTime time.Time `orm:"column(update_time);type(datetime);auto_now" json:"update_time"`
|
||||
}
|
||||
|
||||
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// SystemSMS 短信配置表 yz_system_sms
|
||||
type SystemSMS struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
ConfigCode string `orm:"column(config_code);size(64)" json:"config_code"`
|
||||
ConfigName string `orm:"column(config_name);size(128)" json:"config_name"`
|
||||
ChannelType int8 `orm:"column(channel_type);default(1)" json:"channel_type"`
|
||||
|
||||
ApiURL string `orm:"column(api_url);size(512);default('')" json:"api_url"`
|
||||
ApiKey string `orm:"column(api_key);size(256);default('')" json:"api_key"`
|
||||
ApiSecret string `orm:"column(api_secret);size(256);default('')" json:"api_secret"`
|
||||
|
||||
SignName string `orm:"column(sign_name);size(128);default('')" json:"sign_name"`
|
||||
TemplateID string `orm:"column(template_id);size(128);default('')" json:"template_id"`
|
||||
ExtraParams *string `orm:"column(extra_params);type(json);null" json:"extra_params"`
|
||||
|
||||
TestPhone string `orm:"column(test_phone);size(64);default('')" json:"test_phone"`
|
||||
|
||||
Weight int `orm:"column(weight);default(10)" json:"weight"`
|
||||
IsDefault int8 `orm:"column(is_default);default(0)" json:"is_default"`
|
||||
Status int8 `orm:"column(status);default(1)" json:"status"`
|
||||
Remark string `orm:"column(remark);size(512);default('')" json:"remark"`
|
||||
CreateTime time.Time `orm:"column(create_time);type(datetime);auto_now_add" json:"create_time"`
|
||||
UpdateTime time.Time `orm:"column(update_time);type(datetime);auto_now" json:"update_time"`
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// SystemSMSTask 短信任务表 yz_system_sms_tasks
|
||||
type SystemSMSTask struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Tid *uint64 `orm:"column(tid);null" json:"tid"` // 测试允许为空
|
||||
ApiKey string `orm:"column(api_key);size(255)" json:"api_key"`
|
||||
Phone string `orm:"column(phone);size(50)" json:"phone"`
|
||||
Content *string `orm:"column(content);type(text);null" json:"content"`
|
||||
Status int `orm:"column(status);default(0)" json:"status"`
|
||||
Code string `orm:"column(code);size(20);default('')" json:"code"`
|
||||
ReportRaw *string `orm:"column(report_raw);type(text);null" json:"report_raw"`
|
||||
CreateTime *time.Time `orm:"column(create_time);type(datetime);null" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *SystemSMSTask) TableName() string {
|
||||
return "yz_system_sms_tasks"
|
||||
}
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// SystemSMSTask 短信任务表 yz_system_sms_tasks
|
||||
type SystemSMSTask struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Tid *uint64 `orm:"column(tid);null" json:"tid"` // 测试允许为空
|
||||
ApiKey string `orm:"column(api_key);size(255)" json:"api_key"`
|
||||
Phone string `orm:"column(phone);size(50)" json:"phone"`
|
||||
Content *string `orm:"column(content);type(text);null" json:"content"`
|
||||
Status int `orm:"column(status);default(0)" json:"status"`
|
||||
Code string `orm:"column(code);size(20);default('')" json:"code"`
|
||||
ReportRaw *string `orm:"column(report_raw);type(text);null" json:"report_raw"`
|
||||
CreateTime *time.Time `orm:"column(create_time);type(datetime);null" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *SystemSMSTask) TableName() string {
|
||||
return "yz_system_sms_tasks"
|
||||
}
|
||||
|
||||
@@ -4,19 +4,20 @@ import "time"
|
||||
|
||||
// SystemSoftwareUpgrade 软件升级产品 yz_system_software_upgrade
|
||||
type SystemSoftwareUpgrade struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Name string `orm:"column(name);size(128)" json:"name"`
|
||||
Code string `orm:"column(code);size(64);unique" json:"code"`
|
||||
LatestVersion string `orm:"column(latest_version);size(32)" json:"latestVersion"`
|
||||
FileID *uint64 `orm:"column(file_id);null" json:"fileId"`
|
||||
DownloadURL *string `orm:"column(download_url);size(512);null" json:"downloadUrl"`
|
||||
ForceUpdate int8 `orm:"column(force_update);default(0)" json:"forceUpdate"`
|
||||
ReleaseNotes *string `orm:"column(release_notes);size(2000);null" json:"releaseNotes"`
|
||||
Status int8 `orm:"column(status);default(1)" json:"status"`
|
||||
Sort int `orm:"column(sort);default(0)" json:"sort"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"createTime"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);auto_now;type(datetime);null" json:"updateTime"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"deleteTime"`
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Name string `orm:"column(name);size(128)" json:"name"`
|
||||
Code string `orm:"column(code);size(64);unique" json:"code"`
|
||||
LatestVersion string `orm:"column(latest_version);size(32)" json:"latestVersion"`
|
||||
FileID *uint64 `orm:"column(file_id);null" json:"fileId"`
|
||||
DownloadURL *string `orm:"column(download_url);size(512);null" json:"downloadUrl"`
|
||||
DownloadURLs *string `orm:"column(download_urls);type(text);null" json:"downloadUrls"`
|
||||
ForceUpdate int8 `orm:"column(force_update);default(0)" json:"forceUpdate"`
|
||||
ReleaseNotes *string `orm:"column(release_notes);size(2000);null" json:"releaseNotes"`
|
||||
Status int8 `orm:"column(status);default(1)" json:"status"`
|
||||
Sort int `orm:"column(sort);default(0)" json:"sort"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"createTime"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);auto_now;type(datetime);null" json:"updateTime"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"deleteTime"`
|
||||
}
|
||||
|
||||
func (m *SystemSoftwareUpgrade) TableName() string {
|
||||
|
||||
+23
-23
@@ -1,23 +1,23 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
type SystemTenant struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
TenantCode string `orm:"column(tenant_code);size(32)" json:"tenant_code"`
|
||||
TenantName string `orm:"column(tenant_name);size(128)" json:"tenant_name"`
|
||||
ContactPerson *string `orm:"column(contact_person);size(64);null" json:"contact_person"`
|
||||
ContactPhone *string `orm:"column(contact_phone);size(20);null" json:"contact_phone"`
|
||||
ContactEmail *string `orm:"column(contact_email);size(128);null" json:"contact_email"`
|
||||
Address *string `orm:"column(address);size(255);null" json:"address"`
|
||||
Worktime *string `orm:"column(worktime);size(255);null" json:"worktime"`
|
||||
Status int8 `orm:"column(status);default(1)" json:"status"`
|
||||
Remark *string `orm:"column(remark);size(512);null" json:"remark"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
||||
UpdateTime time.Time `orm:"column(update_time);auto_now;type(datetime)" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *SystemTenant) TableName() string {
|
||||
return "yz_system_tenant"
|
||||
}
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
type SystemTenant struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
TenantCode string `orm:"column(tenant_code);size(32)" json:"tenant_code"`
|
||||
TenantName string `orm:"column(tenant_name);size(128)" json:"tenant_name"`
|
||||
ContactPerson *string `orm:"column(contact_person);size(64);null" json:"contact_person"`
|
||||
ContactPhone *string `orm:"column(contact_phone);size(20);null" json:"contact_phone"`
|
||||
ContactEmail *string `orm:"column(contact_email);size(128);null" json:"contact_email"`
|
||||
Address *string `orm:"column(address);size(255);null" json:"address"`
|
||||
Worktime *string `orm:"column(worktime);size(255);null" json:"worktime"`
|
||||
Status int8 `orm:"column(status);default(1)" json:"status"`
|
||||
Remark *string `orm:"column(remark);size(512);null" json:"remark"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
||||
UpdateTime time.Time `orm:"column(update_time);auto_now;type(datetime)" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *SystemTenant) TableName() string {
|
||||
return "yz_system_tenant"
|
||||
}
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// SystemTenantDomain 租户域名表 yz_tenant_domain
|
||||
type SystemTenantDomain struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Tid *uint64 `orm:"column(tid);null" json:"tid"`
|
||||
SubDomain *string `orm:"column(sub_domain);size(50);null" json:"sub_domain"`
|
||||
MainDomain *string `orm:"column(main_domain);size(255);null" json:"main_domain"`
|
||||
FullDomain *string `orm:"column(full_domain);size(255);null" json:"full_domain"`
|
||||
Status int `orm:"column(status);null" json:"status"` // 1已生效 / 0审核中 / 2禁用
|
||||
CreateTime time.Time `orm:"column(create_time);type(datetime);auto_now_add" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);auto_now;null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *SystemTenantDomain) TableName() string {
|
||||
return "yz_system_tenant_domain"
|
||||
}
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// SystemTenantDomain 租户域名表 yz_tenant_domain
|
||||
type SystemTenantDomain struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Tid *uint64 `orm:"column(tid);null" json:"tid"`
|
||||
SubDomain *string `orm:"column(sub_domain);size(50);null" json:"sub_domain"`
|
||||
MainDomain *string `orm:"column(main_domain);size(255);null" json:"main_domain"`
|
||||
FullDomain *string `orm:"column(full_domain);size(255);null" json:"full_domain"`
|
||||
Status int `orm:"column(status);null" json:"status"` // 1已生效 / 0审核中 / 2禁用
|
||||
CreateTime time.Time `orm:"column(create_time);type(datetime);auto_now_add" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);auto_now;null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *SystemTenantDomain) TableName() string {
|
||||
return "yz_system_tenant_domain"
|
||||
}
|
||||
|
||||
@@ -1,30 +1,30 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// TenantSiteSetting 租户站点设置表 yz_tenant_site_setting
|
||||
// 主要用于“站点基本信息”配置(站点名称/Logo/企业介绍等)
|
||||
type TenantSiteSetting struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
|
||||
Tid uint64 `orm:"column(tid);null" json:"tid"`
|
||||
|
||||
Sitename string `orm:"column(sitename);size(255);null" json:"sitename"`
|
||||
Logo string `orm:"column(logo);size(255);null" json:"logo"`
|
||||
Logow string `orm:"column(logow);size(255);null" json:"logow"`
|
||||
Ico string `orm:"column(ico);size(255);null" json:"ico"`
|
||||
|
||||
Companyintroduction string `orm:"column(companyintroduction);type(longtext);null" json:"companyintroduction"`
|
||||
Description string `orm:"column(description);size(255);null" json:"description"`
|
||||
Copyright string `orm:"column(copyright);size(255);null" json:"copyright"`
|
||||
Companyname string `orm:"column(companyname);size(255);null" json:"companyname"`
|
||||
Icp string `orm:"column(icp);size(255);null" json:"icp"`
|
||||
|
||||
CreateTime time.Time `orm:"column(create_time);type(datetime);auto_now_add;null" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);auto_now;null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *TenantSiteSetting) TableName() string {
|
||||
return "yz_system_tenant_site_setting"
|
||||
}
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// TenantSiteSetting 租户站点设置表 yz_tenant_site_setting
|
||||
// 主要用于“站点基本信息”配置(站点名称/Logo/企业介绍等)
|
||||
type TenantSiteSetting struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
|
||||
Tid uint64 `orm:"column(tid);null" json:"tid"`
|
||||
|
||||
Sitename string `orm:"column(sitename);size(255);null" json:"sitename"`
|
||||
Logo string `orm:"column(logo);size(255);null" json:"logo"`
|
||||
Logow string `orm:"column(logow);size(255);null" json:"logow"`
|
||||
Ico string `orm:"column(ico);size(255);null" json:"ico"`
|
||||
|
||||
Companyintroduction string `orm:"column(companyintroduction);type(longtext);null" json:"companyintroduction"`
|
||||
Description string `orm:"column(description);size(255);null" json:"description"`
|
||||
Copyright string `orm:"column(copyright);size(255);null" json:"copyright"`
|
||||
Companyname string `orm:"column(companyname);size(255);null" json:"companyname"`
|
||||
Icp string `orm:"column(icp);size(255);null" json:"icp"`
|
||||
|
||||
CreateTime time.Time `orm:"column(create_time);type(datetime);auto_now_add;null" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);type(datetime);auto_now;null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *TenantSiteSetting) TableName() string {
|
||||
return "yz_system_tenant_site_setting"
|
||||
}
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
type SystemTenantUser struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Tid uint64 `orm:"column(tid)" json:"tid"`
|
||||
Uid uint64 `orm:"column(uid)" json:"uid"`
|
||||
Account *string `orm:"column(account);size(64);null" json:"account"`
|
||||
Name *string `orm:"column(name);size(64);null" json:"name"`
|
||||
Phone *string `orm:"column(phone);size(20);null" json:"phone"`
|
||||
Email *string `orm:"column(email);size(128);null" json:"email"`
|
||||
Sex uint8 `orm:"column(sex);default(0)" json:"sex"`
|
||||
Birth *string `orm:"column(birth);size(20);null" json:"birth"`
|
||||
Password *string `orm:"column(password);size(255);null" json:"password"`
|
||||
IsDefault int8 `orm:"column(is_default);default(0)" json:"is_default"`
|
||||
Status int8 `orm:"column(status);default(1)" json:"status"`
|
||||
Remark *string `orm:"column(remark);size(255);null" json:"remark"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);auto_now;type(datetime);null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *SystemTenantUser) TableName() string {
|
||||
return "yz_system_tenant_user"
|
||||
}
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
type SystemTenantUser struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
Tid uint64 `orm:"column(tid)" json:"tid"`
|
||||
Uid uint64 `orm:"column(uid)" json:"uid"`
|
||||
Account *string `orm:"column(account);size(64);null" json:"account"`
|
||||
Name *string `orm:"column(name);size(64);null" json:"name"`
|
||||
Phone *string `orm:"column(phone);size(20);null" json:"phone"`
|
||||
Email *string `orm:"column(email);size(128);null" json:"email"`
|
||||
Sex uint8 `orm:"column(sex);default(0)" json:"sex"`
|
||||
Birth *string `orm:"column(birth);size(20);null" json:"birth"`
|
||||
Password *string `orm:"column(password);size(255);null" json:"password"`
|
||||
IsDefault int8 `orm:"column(is_default);default(0)" json:"is_default"`
|
||||
Status int8 `orm:"column(status);default(1)" json:"status"`
|
||||
Remark *string `orm:"column(remark);size(255);null" json:"remark"`
|
||||
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
||||
UpdateTime *time.Time `orm:"column(update_time);auto_now;type(datetime);null" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
}
|
||||
|
||||
func (m *SystemTenantUser) TableName() string {
|
||||
return "yz_system_tenant_user"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user