Blame view

models/email.go 936 Bytes
e172952c   zhangqijia   feat: email 系统搭建
1
2
3
  package models
  
  import (
e172952c   zhangqijia   feat: email 系统搭建
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  	"pro2d/common/components"
  	"pro2d/pb"
  )
  
  const EMAIL_LIMIT = 50
  
  type EmailModel struct {
  	components.ISchema
  	Data *pb.Email
  }
  
  func NewEmailModel(id string) *EmailModel {
  	data := &pb.Email{Id: id}
  	m := &EmailModel{
  		ISchema: NewSchema(data.Id, data),
  		Data:    data,
  	}
  	return m
  }
  
  func NewEmailModelPB(email *pb.Email) *EmailModel {
  	m := &EmailModel{
  		ISchema: NewSchema(email.Id, email),
  		Data:    email,
  	}
  	return m
  }
  
e172952c   zhangqijia   feat: email 系统搭建
32
33
34
35
36
37
38
39
40
41
42
43
44
  func (m *EmailModel) Log(role *RoleModel, action int32) {
  	//{desc = "onMail", int1 = self:getProperty("id"), int2 = self:getProperty("status"), cint1 = self:getProperty("emailId"),
  	//	short1 = action, key1=self:getProperty("title"), key2=self:getProperty("attachments")})
  	role.MyLog("mail_action", &pb.LogConf{
  		Desc: "onMail",
  		//Int1: email.Data.Id,
  		Int2: string(m.Data.Status),
  		//Cint1:
  		Short1: action,
  		Key1:   m.Data.Title,
  		Key2:   m.Data.Attachments,
  	})
  }