123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256 |
- package batchmsg
- import (
- "time"
- "entgo.io/ent"
- "entgo.io/ent/dialect/sql"
- )
- const (
-
- Label = "batch_msg"
-
- FieldID = "id"
-
- FieldCreatedAt = "created_at"
-
- FieldUpdatedAt = "updated_at"
-
- FieldDeletedAt = "deleted_at"
-
- FieldStatus = "status"
-
- FieldBatchNo = "batch_no"
-
- FieldTaskName = "task_name"
-
- FieldFromwxid = "fromwxid"
-
- FieldMsg = "msg"
-
- FieldTag = "tag"
-
- FieldTagids = "tagids"
-
- FieldTotal = "total"
-
- FieldSuccess = "success"
-
- FieldFail = "fail"
-
- FieldStartTime = "start_time"
-
- FieldStopTime = "stop_time"
-
- FieldSendTime = "send_time"
-
- FieldType = "type"
-
- FieldOrganizationID = "organization_id"
-
- FieldCtype = "ctype"
-
- FieldCc = "cc"
-
- FieldPhone = "phone"
-
- FieldTemplateName = "template_name"
-
- FieldTemplateCode = "template_code"
-
- FieldLang = "lang"
-
- Table = "batch_msg"
- )
- var Columns = []string{
- FieldID,
- FieldCreatedAt,
- FieldUpdatedAt,
- FieldDeletedAt,
- FieldStatus,
- FieldBatchNo,
- FieldTaskName,
- FieldFromwxid,
- FieldMsg,
- FieldTag,
- FieldTagids,
- FieldTotal,
- FieldSuccess,
- FieldFail,
- FieldStartTime,
- FieldStopTime,
- FieldSendTime,
- FieldType,
- FieldOrganizationID,
- FieldCtype,
- FieldCc,
- FieldPhone,
- FieldTemplateName,
- FieldTemplateCode,
- FieldLang,
- }
- func ValidColumn(column string) bool {
- for i := range Columns {
- if column == Columns[i] {
- return true
- }
- }
- return false
- }
- var (
- Hooks [1]ent.Hook
- Interceptors [1]ent.Interceptor
-
- DefaultCreatedAt func() time.Time
-
- DefaultUpdatedAt func() time.Time
-
- UpdateDefaultUpdatedAt func() time.Time
-
- DefaultTaskName string
-
- OrganizationIDValidator func(uint64) error
-
- DefaultCtype uint64
- )
- type OrderOption func(*sql.Selector)
- func ByID(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldID, opts...).ToFunc()
- }
- func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
- }
- func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
- }
- func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
- }
- func ByStatus(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldStatus, opts...).ToFunc()
- }
- func ByBatchNo(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldBatchNo, opts...).ToFunc()
- }
- func ByTaskName(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldTaskName, opts...).ToFunc()
- }
- func ByFromwxid(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldFromwxid, opts...).ToFunc()
- }
- func ByMsg(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldMsg, opts...).ToFunc()
- }
- func ByTag(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldTag, opts...).ToFunc()
- }
- func ByTagids(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldTagids, opts...).ToFunc()
- }
- func ByTotal(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldTotal, opts...).ToFunc()
- }
- func BySuccess(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldSuccess, opts...).ToFunc()
- }
- func ByFail(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldFail, opts...).ToFunc()
- }
- func ByStartTime(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldStartTime, opts...).ToFunc()
- }
- func ByStopTime(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldStopTime, opts...).ToFunc()
- }
- func BySendTime(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldSendTime, opts...).ToFunc()
- }
- func ByType(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldType, opts...).ToFunc()
- }
- func ByOrganizationID(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldOrganizationID, opts...).ToFunc()
- }
- func ByCtype(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldCtype, opts...).ToFunc()
- }
- func ByCc(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldCc, opts...).ToFunc()
- }
- func ByPhone(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldPhone, opts...).ToFunc()
- }
- func ByTemplateName(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldTemplateName, opts...).ToFunc()
- }
- func ByTemplateCode(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldTemplateCode, opts...).ToFunc()
- }
- func ByLang(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldLang, opts...).ToFunc()
- }
|