处罚调整

dev
truthhun 11 months ago
parent b09629b117
commit 006a8f1827

@ -35,18 +35,17 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// 这里是proto文件中的结构体可以根据需要删除或者调整
type Punishment struct {
StartTime *time.Time `protobuf:"bytes,6,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time,omitempty"`
EndTime *time.Time `protobuf:"bytes,7,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time,omitempty"`
CreatedAt *time.Time `protobuf:"bytes,8,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at,omitempty"`
UpdatedAt *time.Time `protobuf:"bytes,9,opt,name=updated_at,json=updatedAt,proto3,stdtime" json:"updated_at,omitempty"`
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
Type int32 `protobuf:"varint,3,opt,name=type,proto3" json:"type,omitempty"`
Enable bool `protobuf:"varint,4,opt,name=enable,proto3" json:"enable,omitempty"`
Operators string `protobuf:"bytes,5,opt,name=operators,proto3" json:"operators,omitempty"`
Remark string `protobuf:"bytes,10,opt,name=remark,proto3" json:"remark,omitempty"`
Reason string `protobuf:"bytes,11,opt,name=reason,proto3" json:"reason,omitempty"`
Username string `protobuf:"bytes,12,opt,name=username,proto3" json:"username,omitempty"`
EndTime *time.Time `protobuf:"bytes,1,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time,omitempty"`
CreatedAt *time.Time `protobuf:"bytes,2,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at,omitempty"`
UpdatedAt *time.Time `protobuf:"bytes,3,opt,name=updated_at,json=updatedAt,proto3,stdtime" json:"updated_at,omitempty"`
Id int64 `protobuf:"varint,4,opt,name=id,proto3" json:"id,omitempty"`
UserId int64 `protobuf:"varint,5,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
Type int32 `protobuf:"varint,6,opt,name=type,proto3" json:"type,omitempty"`
Enable bool `protobuf:"varint,7,opt,name=enable,proto3" json:"enable,omitempty"`
Operators string `protobuf:"bytes,8,opt,name=operators,proto3" json:"operators,omitempty"`
Remark string `protobuf:"bytes,9,opt,name=remark,proto3" json:"remark,omitempty"`
Reason string `protobuf:"bytes,10,opt,name=reason,proto3" json:"reason,omitempty"`
Username string `protobuf:"bytes,11,opt,name=username,proto3" json:"username,omitempty"`
}
func (m *Punishment) Reset() { *m = Punishment{} }
@ -82,13 +81,6 @@ func (m *Punishment) XXX_DiscardUnknown() {
var xxx_messageInfo_Punishment proto.InternalMessageInfo
func (m *Punishment) GetStartTime() *time.Time {
if m != nil {
return m.StartTime
}
return nil
}
func (m *Punishment) GetEndTime() *time.Time {
if m != nil {
return m.EndTime
@ -355,14 +347,13 @@ func (m *ListPunishmentRequest) GetUserId() []int64 {
}
type CreatePunishmentRequest struct {
StartTime *time.Time `protobuf:"bytes,1,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time,omitempty"`
EndTime *time.Time `protobuf:"bytes,2,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time,omitempty"`
Id int64 `protobuf:"varint,3,opt,name=id,proto3" json:"id,omitempty"`
UserId []int64 `protobuf:"varint,4,rep,packed,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
Type []int32 `protobuf:"varint,5,rep,packed,name=type,proto3" json:"type,omitempty"`
Enable bool `protobuf:"varint,6,opt,name=enable,proto3" json:"enable,omitempty"`
Remark string `protobuf:"bytes,7,opt,name=remark,proto3" json:"remark,omitempty"`
Reason string `protobuf:"bytes,8,opt,name=reason,proto3" json:"reason,omitempty"`
EndTime *time.Time `protobuf:"bytes,1,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time,omitempty"`
Id int64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"`
UserId []int64 `protobuf:"varint,3,rep,packed,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
Type []int32 `protobuf:"varint,4,rep,packed,name=type,proto3" json:"type,omitempty"`
Enable bool `protobuf:"varint,5,opt,name=enable,proto3" json:"enable,omitempty"`
Remark string `protobuf:"bytes,6,opt,name=remark,proto3" json:"remark,omitempty"`
Reason string `protobuf:"bytes,7,opt,name=reason,proto3" json:"reason,omitempty"`
}
func (m *CreatePunishmentRequest) Reset() { *m = CreatePunishmentRequest{} }
@ -398,13 +389,6 @@ func (m *CreatePunishmentRequest) XXX_DiscardUnknown() {
var xxx_messageInfo_CreatePunishmentRequest proto.InternalMessageInfo
func (m *CreatePunishmentRequest) GetStartTime() *time.Time {
if m != nil {
return m.StartTime
}
return nil
}
func (m *CreatePunishmentRequest) GetEndTime() *time.Time {
if m != nil {
return m.EndTime
@ -518,54 +502,52 @@ func init() {
func init() { proto.RegisterFile("api/v1/punishment.proto", fileDescriptor_165d39e292001fbd) }
var fileDescriptor_165d39e292001fbd = []byte{
// 737 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcd, 0x6e, 0xd3, 0x40,
0x10, 0xee, 0xda, 0xf9, 0x9d, 0xd2, 0xaa, 0x2c, 0xa1, 0x71, 0xdd, 0x36, 0xb1, 0x2c, 0x84, 0x42,
0x0f, 0x89, 0x1a, 0xc4, 0xa5, 0x3d, 0x54, 0x6d, 0x85, 0x50, 0x25, 0x0e, 0x95, 0x05, 0x17, 0x24,
0x14, 0x6d, 0xe3, 0x6d, 0x30, 0xd8, 0x5e, 0xd7, 0xde, 0xb4, 0x0a, 0x47, 0x9e, 0xa0, 0x12, 0x47,
0x78, 0x18, 0x8e, 0x48, 0x5c, 0x2a, 0x71, 0xe1, 0x06, 0x6a, 0x79, 0x10, 0xe4, 0xf5, 0x3a, 0xbf,
0x8e, 0x28, 0xe2, 0xb6, 0x33, 0xb3, 0xf3, 0x7d, 0x3b, 0xdf, 0x8c, 0xc7, 0x50, 0x25, 0x81, 0xd3,
0x3a, 0xdf, 0x6e, 0x05, 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 0x95, 0xe9,
0x05, 0x32, 0xd6, 0x98, 0xec, 0xd5, 0x32, 0x57, 0xb9, 0x07, 0x82, 0xad, 0xa6, 0xaf, 0x65, 0xb0,
0x75, 0x05, 0xd6, 0x0e, 0xda, 0x3a, 0x78, 0xf2, 0xf5, 0xba, 0x86, 0xae, 0xae, 0x6b, 0xe8, 0xd7,
0x75, 0x0d, 0x5d, 0xde, 0xd4, 0x16, 0xae, 0x6e, 0x6a, 0x0b, 0x3f, 0x6e, 0x6a, 0x0b, 0x20, 0xff,
0x8a, 0xc7, 0xe8, 0xd5, 0x5d, 0x8f, 0x85, 0xd4, 0x66, 0x5d, 0x09, 0xb4, 0x7b, 0xbe, 0x7d, 0x52,
0x10, 0x64, 0x8f, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x70, 0x53, 0x08, 0x46, 0x54, 0x07, 0x00,
0x00,
// 719 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4f, 0x6f, 0xd3, 0x4e,
0x10, 0xed, 0xc6, 0xf9, 0x3b, 0x55, 0xab, 0xfe, 0xf6, 0x17, 0x1a, 0xd7, 0x6d, 0x93, 0xc8, 0x42,
0xc8, 0xf4, 0x60, 0xab, 0x41, 0x5c, 0xda, 0x03, 0x6a, 0x2b, 0x84, 0x2a, 0x71, 0xa8, 0x2c, 0xb8,
0x20, 0xa1, 0x68, 0x1b, 0x6f, 0x83, 0xc1, 0xf6, 0xba, 0xf6, 0xa6, 0x55, 0x38, 0x72, 0xe4, 0x54,
0x89, 0x23, 0x5f, 0x86, 0x23, 0xc7, 0x4a, 0x5c, 0x90, 0x38, 0x80, 0x5a, 0x3e, 0x08, 0xda, 0xb5,
0xdd, 0xb8, 0x89, 0x23, 0x2a, 0x71, 0xdb, 0x99, 0xd9, 0x79, 0x6f, 0xe7, 0xcd, 0xec, 0x2e, 0xb4,
0x48, 0xe8, 0x5a, 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x05, 0x6c, 0x03, 0x89,
0xb5, 0x83, 0xb6, 0xf6, 0x1f, 0x7f, 0xbd, 0x6a, 0xa3, 0xcb, 0xab, 0x36, 0xfa, 0x75, 0xd5, 0x46,
0x17, 0xd7, 0xed, 0x85, 0xcb, 0xeb, 0xf6, 0xc2, 0xf7, 0xeb, 0xf6, 0x02, 0xa4, 0x7f, 0xd2, 0x11,
0x7a, 0xf5, 0x9f, 0xcf, 0x22, 0xea, 0xb0, 0x41, 0x0a, 0xb4, 0x7b, 0xb6, 0x7d, 0x5c, 0x95, 0x64,
0x8f, 0xfe, 0x04, 0x00, 0x00, 0xff, 0xff, 0x48, 0x05, 0x8d, 0xd3, 0xd2, 0x06, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@ -819,68 +801,28 @@ func (m *Punishment) MarshalToSizedBuffer(dAtA []byte) (int, error) {
copy(dAtA[i:], m.Username)
i = encodeVarintPunishment(dAtA, i, uint64(len(m.Username)))
i--
dAtA[i] = 0x62
dAtA[i] = 0x5a
}
if len(m.Reason) > 0 {
i -= len(m.Reason)
copy(dAtA[i:], m.Reason)
i = encodeVarintPunishment(dAtA, i, uint64(len(m.Reason)))
i--
dAtA[i] = 0x5a
dAtA[i] = 0x52
}
if len(m.Remark) > 0 {
i -= len(m.Remark)
copy(dAtA[i:], m.Remark)
i = encodeVarintPunishment(dAtA, i, uint64(len(m.Remark)))
i--
dAtA[i] = 0x52
}
if m.UpdatedAt != nil {
n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.UpdatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.UpdatedAt):])
if err1 != nil {
return 0, err1
}
i -= n1
i = encodeVarintPunishment(dAtA, i, uint64(n1))
i--
dAtA[i] = 0x4a
}
if m.CreatedAt != nil {
n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.CreatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.CreatedAt):])
if err2 != nil {
return 0, err2
}
i -= n2
i = encodeVarintPunishment(dAtA, i, uint64(n2))
i--
dAtA[i] = 0x42
}
if m.EndTime != nil {
n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.EndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.EndTime):])
if err3 != nil {
return 0, err3
}
i -= n3
i = encodeVarintPunishment(dAtA, i, uint64(n3))
i--
dAtA[i] = 0x3a
}
if m.StartTime != nil {
n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.StartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.StartTime):])
if err4 != nil {
return 0, err4
}
i -= n4
i = encodeVarintPunishment(dAtA, i, uint64(n4))
i--
dAtA[i] = 0x32
}
if len(m.Operators) > 0 {
i -= len(m.Operators)
copy(dAtA[i:], m.Operators)
i = encodeVarintPunishment(dAtA, i, uint64(len(m.Operators)))
i--
dAtA[i] = 0x2a
dAtA[i] = 0x42
}
if m.Enable {
i--
@ -890,22 +832,52 @@ func (m *Punishment) MarshalToSizedBuffer(dAtA []byte) (int, error) {
dAtA[i] = 0
}
i--
dAtA[i] = 0x20
dAtA[i] = 0x38
}
if m.Type != 0 {
i = encodeVarintPunishment(dAtA, i, uint64(m.Type))
i--
dAtA[i] = 0x18
dAtA[i] = 0x30
}
if m.UserId != 0 {
i = encodeVarintPunishment(dAtA, i, uint64(m.UserId))
i--
dAtA[i] = 0x10
dAtA[i] = 0x28
}
if m.Id != 0 {
i = encodeVarintPunishment(dAtA, i, uint64(m.Id))
i--
dAtA[i] = 0x8
dAtA[i] = 0x20
}
if m.UpdatedAt != nil {
n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.UpdatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.UpdatedAt):])
if err1 != nil {
return 0, err1
}
i -= n1
i = encodeVarintPunishment(dAtA, i, uint64(n1))
i--
dAtA[i] = 0x1a
}
if m.CreatedAt != nil {
n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.CreatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.CreatedAt):])
if err2 != nil {
return 0, err2
}
i -= n2
i = encodeVarintPunishment(dAtA, i, uint64(n2))
i--
dAtA[i] = 0x12
}
if m.EndTime != nil {
n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.EndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.EndTime):])
if err3 != nil {
return 0, err3
}
i -= n3
i = encodeVarintPunishment(dAtA, i, uint64(n3))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
@ -931,21 +903,21 @@ func (m *CancelPunishmentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
var l int
_ = l
if len(m.Id) > 0 {
dAtA6 := make([]byte, len(m.Id)*10)
var j5 int
dAtA5 := make([]byte, len(m.Id)*10)
var j4 int
for _, num1 := range m.Id {
num := uint64(num1)
for num >= 1<<7 {
dAtA6[j5] = uint8(uint64(num)&0x7f | 0x80)
dAtA5[j4] = uint8(uint64(num)&0x7f | 0x80)
num >>= 7
j5++
j4++
}
dAtA6[j5] = uint8(num)
j5++
dAtA5[j4] = uint8(num)
j4++
}
i -= j5
copy(dAtA[i:], dAtA6[:j5])
i = encodeVarintPunishment(dAtA, i, uint64(j5))
i -= j4
copy(dAtA[i:], dAtA5[:j4])
i = encodeVarintPunishment(dAtA, i, uint64(j4))
i--
dAtA[i] = 0xa
}
@ -1001,59 +973,59 @@ func (m *ListPunishmentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
var l int
_ = l
if len(m.UserId) > 0 {
dAtA8 := make([]byte, len(m.UserId)*10)
var j7 int
dAtA7 := make([]byte, len(m.UserId)*10)
var j6 int
for _, num1 := range m.UserId {
num := uint64(num1)
for num >= 1<<7 {
dAtA8[j7] = uint8(uint64(num)&0x7f | 0x80)
dAtA7[j6] = uint8(uint64(num)&0x7f | 0x80)
num >>= 7
j7++
j6++
}
dAtA8[j7] = uint8(num)
j7++
dAtA7[j6] = uint8(num)
j6++
}
i -= j7
copy(dAtA[i:], dAtA8[:j7])
i = encodeVarintPunishment(dAtA, i, uint64(j7))
i -= j6
copy(dAtA[i:], dAtA7[:j6])
i = encodeVarintPunishment(dAtA, i, uint64(j6))
i--
dAtA[i] = 0x42
}
if len(m.Enable) > 0 {
dAtA10 := make([]byte, len(m.Enable)*10)
var j9 int
dAtA9 := make([]byte, len(m.Enable)*10)
var j8 int
for _, num1 := range m.Enable {
num := uint64(num1)
for num >= 1<<7 {
dAtA10[j9] = uint8(uint64(num)&0x7f | 0x80)
dAtA9[j8] = uint8(uint64(num)&0x7f | 0x80)
num >>= 7
j9++
j8++
}
dAtA10[j9] = uint8(num)
j9++
dAtA9[j8] = uint8(num)
j8++
}
i -= j9
copy(dAtA[i:], dAtA10[:j9])
i = encodeVarintPunishment(dAtA, i, uint64(j9))
i -= j8
copy(dAtA[i:], dAtA9[:j8])
i = encodeVarintPunishment(dAtA, i, uint64(j8))
i--
dAtA[i] = 0x3a
}
if len(m.Type) > 0 {
dAtA12 := make([]byte, len(m.Type)*10)
var j11 int
dAtA11 := make([]byte, len(m.Type)*10)
var j10 int
for _, num1 := range m.Type {
num := uint64(num1)
for num >= 1<<7 {
dAtA12[j11] = uint8(uint64(num)&0x7f | 0x80)
dAtA11[j10] = uint8(uint64(num)&0x7f | 0x80)
num >>= 7
j11++
j10++
}
dAtA12[j11] = uint8(num)
j11++
dAtA11[j10] = uint8(num)
j10++
}
i -= j11
copy(dAtA[i:], dAtA12[:j11])
i = encodeVarintPunishment(dAtA, i, uint64(j11))
i -= j10
copy(dAtA[i:], dAtA11[:j10])
i = encodeVarintPunishment(dAtA, i, uint64(j10))
i--
dAtA[i] = 0x32
}
@ -1118,14 +1090,14 @@ func (m *CreatePunishmentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
copy(dAtA[i:], m.Reason)
i = encodeVarintPunishment(dAtA, i, uint64(len(m.Reason)))
i--
dAtA[i] = 0x42
dAtA[i] = 0x3a
}
if len(m.Remark) > 0 {
i -= len(m.Remark)
copy(dAtA[i:], m.Remark)
i = encodeVarintPunishment(dAtA, i, uint64(len(m.Remark)))
i--
dAtA[i] = 0x3a
dAtA[i] = 0x32
}
if m.Enable {
i--
@ -1135,68 +1107,58 @@ func (m *CreatePunishmentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
dAtA[i] = 0
}
i--
dAtA[i] = 0x30
dAtA[i] = 0x28
}
if len(m.Type) > 0 {
dAtA14 := make([]byte, len(m.Type)*10)
var j13 int
dAtA13 := make([]byte, len(m.Type)*10)
var j12 int
for _, num1 := range m.Type {
num := uint64(num1)
for num >= 1<<7 {
dAtA14[j13] = uint8(uint64(num)&0x7f | 0x80)
dAtA13[j12] = uint8(uint64(num)&0x7f | 0x80)
num >>= 7
j13++
j12++
}
dAtA14[j13] = uint8(num)
j13++
dAtA13[j12] = uint8(num)
j12++
}
i -= j13
copy(dAtA[i:], dAtA14[:j13])
i = encodeVarintPunishment(dAtA, i, uint64(j13))
i -= j12
copy(dAtA[i:], dAtA13[:j12])
i = encodeVarintPunishment(dAtA, i, uint64(j12))
i--
dAtA[i] = 0x2a
dAtA[i] = 0x22
}
if len(m.UserId) > 0 {
dAtA16 := make([]byte, len(m.UserId)*10)
var j15 int
dAtA15 := make([]byte, len(m.UserId)*10)
var j14 int
for _, num1 := range m.UserId {
num := uint64(num1)
for num >= 1<<7 {
dAtA16[j15] = uint8(uint64(num)&0x7f | 0x80)
dAtA15[j14] = uint8(uint64(num)&0x7f | 0x80)
num >>= 7
j15++
j14++
}
dAtA16[j15] = uint8(num)
j15++
dAtA15[j14] = uint8(num)
j14++
}
i -= j15
copy(dAtA[i:], dAtA16[:j15])
i = encodeVarintPunishment(dAtA, i, uint64(j15))
i -= j14
copy(dAtA[i:], dAtA15[:j14])
i = encodeVarintPunishment(dAtA, i, uint64(j14))
i--
dAtA[i] = 0x22
dAtA[i] = 0x1a
}
if m.Id != 0 {
i = encodeVarintPunishment(dAtA, i, uint64(m.Id))
i--
dAtA[i] = 0x18
dAtA[i] = 0x10
}
if m.EndTime != nil {
n17, err17 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.EndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.EndTime):])
if err17 != nil {
return 0, err17
}
i -= n17
i = encodeVarintPunishment(dAtA, i, uint64(n17))
i--
dAtA[i] = 0x12
}
if m.StartTime != nil {
n18, err18 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.StartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.StartTime):])
if err18 != nil {
return 0, err18
n16, err16 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.EndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.EndTime):])
if err16 != nil {
return 0, err16
}
i -= n18
i = encodeVarintPunishment(dAtA, i, uint64(n18))
i -= n16
i = encodeVarintPunishment(dAtA, i, uint64(n16))
i--
dAtA[i] = 0xa
}
@ -1262,6 +1224,18 @@ func (m *Punishment) Size() (n int) {
}
var l int
_ = l
if m.EndTime != nil {
l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.EndTime)
n += 1 + l + sovPunishment(uint64(l))
}
if m.CreatedAt != nil {
l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.CreatedAt)
n += 1 + l + sovPunishment(uint64(l))
}
if m.UpdatedAt != nil {
l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.UpdatedAt)
n += 1 + l + sovPunishment(uint64(l))
}
if m.Id != 0 {
n += 1 + sovPunishment(uint64(m.Id))
}
@ -1278,22 +1252,6 @@ func (m *Punishment) Size() (n int) {
if l > 0 {
n += 1 + l + sovPunishment(uint64(l))
}
if m.StartTime != nil {
l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.StartTime)
n += 1 + l + sovPunishment(uint64(l))
}
if m.EndTime != nil {
l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.EndTime)
n += 1 + l + sovPunishment(uint64(l))
}
if m.CreatedAt != nil {
l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.CreatedAt)
n += 1 + l + sovPunishment(uint64(l))
}
if m.UpdatedAt != nil {
l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.UpdatedAt)
n += 1 + l + sovPunishment(uint64(l))
}
l = len(m.Remark)
if l > 0 {
n += 1 + l + sovPunishment(uint64(l))
@ -1393,10 +1351,6 @@ func (m *CreatePunishmentRequest) Size() (n int) {
}
var l int
_ = l
if m.StartTime != nil {
l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.StartTime)
n += 1 + l + sovPunishment(uint64(l))
}
if m.EndTime != nil {
l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.EndTime)
n += 1 + l + sovPunishment(uint64(l))
@ -1486,48 +1440,10 @@ func (m *Punishment) Unmarshal(dAtA []byte) error {
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
}
m.Id = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPunishment
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Id |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field UserId", wireType)
}
m.UserId = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPunishment
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.UserId |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 3:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field EndTime", wireType)
}
m.Type = 0
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPunishment
@ -1537,36 +1453,33 @@ func (m *Punishment) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
m.Type |= int32(b&0x7F) << shift
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 4:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Enable", wireType)
if msglen < 0 {
return ErrInvalidLengthPunishment
}
var v int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPunishment
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthPunishment
}
if iNdEx >= l {
if postIndex > l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= int(b&0x7F) << shift
if b < 0x80 {
break
if m.EndTime == nil {
m.EndTime = new(time.Time)
}
if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.EndTime, dAtA[iNdEx:postIndex]); err != nil {
return err
}
m.Enable = bool(v != 0)
case 5:
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Operators", wireType)
return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType)
}
var stringLen uint64
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPunishment
@ -1576,27 +1489,31 @@ func (m *Punishment) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
if msglen < 0 {
return ErrInvalidLengthPunishment
}
postIndex := iNdEx + intStringLen
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthPunishment
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Operators = string(dAtA[iNdEx:postIndex])
if m.CreatedAt == nil {
m.CreatedAt = new(time.Time)
}
if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.CreatedAt, dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 6:
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType)
return fmt.Errorf("proto: wrong wireType = %d for field UpdatedAt", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@ -1623,18 +1540,18 @@ func (m *Punishment) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.StartTime == nil {
m.StartTime = new(time.Time)
if m.UpdatedAt == nil {
m.UpdatedAt = new(time.Time)
}
if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.StartTime, dAtA[iNdEx:postIndex]); err != nil {
if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.UpdatedAt, dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 7:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field EndTime", wireType)
case 4:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
}
var msglen int
m.Id = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPunishment
@ -1644,33 +1561,35 @@ func (m *Punishment) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
m.Id |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthPunishment
case 5:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field UserId", wireType)
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthPunishment
m.UserId = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPunishment
}
if postIndex > l {
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
if m.EndTime == nil {
m.EndTime = new(time.Time)
b := dAtA[iNdEx]
iNdEx++
m.UserId |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.EndTime, dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 8:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType)
case 6:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
}
var msglen int
m.Type = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPunishment
@ -1680,33 +1599,36 @@ func (m *Punishment) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
m.Type |= int32(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthPunishment
case 7:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Enable", wireType)
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthPunishment
var v int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPunishment
}
if postIndex > l {
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
if m.CreatedAt == nil {
m.CreatedAt = new(time.Time)
b := dAtA[iNdEx]
iNdEx++
v |= int(b&0x7F) << shift
if b < 0x80 {
break
}
if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.CreatedAt, dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 9:
m.Enable = bool(v != 0)
case 8:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field UpdatedAt", wireType)
return fmt.Errorf("proto: wrong wireType = %d for field Operators", wireType)
}
var msglen int
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPunishment
@ -1716,29 +1638,25 @@ func (m *Punishment) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthPunishment
}
postIndex := iNdEx + msglen
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthPunishment
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.UpdatedAt == nil {
m.UpdatedAt = new(time.Time)
}
if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.UpdatedAt, dAtA[iNdEx:postIndex]); err != nil {
return err
}
m.Operators = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 10:
case 9:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Remark", wireType)
}
@ -1770,7 +1688,7 @@ func (m *Punishment) Unmarshal(dAtA []byte) error {
}
m.Remark = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 11:
case 10:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType)
}
@ -1802,7 +1720,7 @@ func (m *Punishment) Unmarshal(dAtA []byte) error {
}
m.Reason = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 12:
case 11:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType)
}
@ -2492,42 +2410,6 @@ func (m *CreatePunishmentRequest) Unmarshal(dAtA []byte) error {
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPunishment
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthPunishment
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthPunishment
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.StartTime == nil {
m.StartTime = new(time.Time)
}
if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.StartTime, dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field EndTime", wireType)
}
@ -2563,7 +2445,7 @@ func (m *CreatePunishmentRequest) Unmarshal(dAtA []byte) error {
return err
}
iNdEx = postIndex
case 3:
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
}
@ -2582,7 +2464,7 @@ func (m *CreatePunishmentRequest) Unmarshal(dAtA []byte) error {
break
}
}
case 4:
case 3:
if wireType == 0 {
var v int64
for shift := uint(0); ; shift += 7 {
@ -2658,7 +2540,7 @@ func (m *CreatePunishmentRequest) Unmarshal(dAtA []byte) error {
} else {
return fmt.Errorf("proto: wrong wireType = %d for field UserId", wireType)
}
case 5:
case 4:
if wireType == 0 {
var v int32
for shift := uint(0); ; shift += 7 {
@ -2734,7 +2616,7 @@ func (m *CreatePunishmentRequest) Unmarshal(dAtA []byte) error {
} else {
return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
}
case 6:
case 5:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Enable", wireType)
}
@ -2754,7 +2636,7 @@ func (m *CreatePunishmentRequest) Unmarshal(dAtA []byte) error {
}
}
m.Enable = bool(v != 0)
case 7:
case 6:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Remark", wireType)
}
@ -2786,7 +2668,7 @@ func (m *CreatePunishmentRequest) Unmarshal(dAtA []byte) error {
}
m.Remark = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 8:
case 7:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType)
}

@ -14,18 +14,17 @@ option java_package = "api.v1";
// proto
message Punishment {
google.protobuf.Timestamp start_time = 6 [ (gogoproto.stdtime) = true ];
google.protobuf.Timestamp end_time = 7 [ (gogoproto.stdtime) = true ];
google.protobuf.Timestamp created_at = 8 [ (gogoproto.stdtime) = true ];
google.protobuf.Timestamp updated_at = 9 [ (gogoproto.stdtime) = true ];
int64 id = 1;
int64 user_id = 2;
int32 type = 3;
bool enable = 4;
string operators = 5;
string remark = 10;
string reason = 11;
string username = 12;
google.protobuf.Timestamp end_time = 1 [ (gogoproto.stdtime) = true ];
google.protobuf.Timestamp created_at = 2 [ (gogoproto.stdtime) = true ];
google.protobuf.Timestamp updated_at = 3 [ (gogoproto.stdtime) = true ];
int64 id = 4;
int64 user_id = 5;
int32 type = 6;
bool enable = 7;
string operators = 8;
string remark = 9;
string reason = 10;
string username = 11;
}
message CancelPunishmentRequest { repeated int64 id = 1; }
@ -44,14 +43,13 @@ message ListPunishmentRequest {
}
message CreatePunishmentRequest {
google.protobuf.Timestamp start_time = 1 [ (gogoproto.stdtime) = true ];
google.protobuf.Timestamp end_time = 2 [ (gogoproto.stdtime) = true ];
int64 id = 3;
repeated int64 user_id = 4;
repeated int32 type = 5;
bool enable = 6;
string remark = 7;
string reason = 8;
google.protobuf.Timestamp end_time = 1 [ (gogoproto.stdtime) = true ];
int64 id = 2;
repeated int64 user_id = 3;
repeated int32 type = 4;
bool enable = 5;
string remark = 6;
string reason = 7;
}
message ListPunishmentReply {

@ -3,7 +3,6 @@ package biz
import (
"context"
"strings"
"time"
pb "moredoc/api/v1"
"moredoc/middleware/auth"
@ -45,11 +44,6 @@ func (s *PunishmentAPIService) CreatePunishment(ctx context.Context, req *pb.Cre
return nil, status.Errorf(codes.InvalidArgument, "请选择处罚类型")
}
now := time.Now()
startTime := &now
if req.StartTime != nil {
startTime = req.StartTime
}
for _, userId := range req.UserId {
if userId == 1 {
continue
@ -61,7 +55,6 @@ func (s *PunishmentAPIService) CreatePunishment(ctx context.Context, req *pb.Cre
Enable: req.Enable,
Reason: req.Reason,
Remark: req.Remark,
StartTime: startTime,
EndTime: req.EndTime,
}
s.logger.Debug("CreatePunishment", zap.Any("punishment", punishment), zap.Any("req", req))

@ -24,7 +24,6 @@ type Punishment struct {
Operators string `form:"operators" json:"operators,omitempty" gorm:"column:operators;type:text;comment:操作信息;"`
Reason string `form:"reason" json:"reason,omitempty" gorm:"column:reason;type:text;comment:惩罚原因;"`
Remark string `form:"remark" json:"remark,omitempty" gorm:"column:remark;type:text;comment:惩罚备注;"`
StartTime *time.Time `form:"start_time" json:"start_time,omitempty" gorm:"column:start_time;type:datetime;comment:惩罚开始时间;"`
EndTime *time.Time `form:"end_time" json:"end_time,omitempty" gorm:"column:end_time;type:datetime;comment:惩罚结束时间,没有结束时间,则表示永久;"`
CreatedAt *time.Time `form:"created_at" json:"created_at,omitempty" gorm:"column:created_at;type:datetime;comment:创建时间;"`
UpdatedAt *time.Time `form:"updated_at" json:"updated_at,omitempty" gorm:"column:updated_at;type:datetime;comment:更新时间;"`

@ -56,7 +56,7 @@
</el-select>
</el-form-item>
<el-row :gutter="20">
<el-col :span="6">
<el-col :span="8">
<el-form-item label="是否启用处罚">
<el-switch
v-model="punishment.enable"
@ -68,22 +68,17 @@
>
</el-switch> </el-form-item
></el-col>
<el-col :span="9">
<el-form-item label="起止时间">
<el-date-picker
v-model="punishment.start_time"
type="datetime"
placeholder="请选择处罚开始时间"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="截止时间">
<el-col :span="16">
<el-form-item>
<template slot="label">
<ToolTip content="用户被处罚的截止时间,留空则为永久" />
</template>
<el-date-picker
v-model="punishment.end_time"
type="datetime"
placeholder="请选择处罚截止时间"
:picker-options="datetimePickerPunishmentOptions"
>
</el-date-picker>
</el-form-item>
@ -120,7 +115,10 @@
</template>
<script>
import { createPunishment, updatePunishment } from '~/api/punishment'
import { punishmentTypeOptions } from '~/utils/enum'
import {
punishmentTypeOptions,
datetimePickerPunishmentOptions,
} from '~/utils/enum'
import { listUser } from '~/api/user'
export default {
name: 'FormPunishment',
@ -135,6 +133,7 @@ export default {
data() {
return {
punishmentTypeOptions,
datetimePickerPunishmentOptions,
loading: false,
punishment: {
id: 0,

@ -0,0 +1,16 @@
<template>
<el-tooltip class="item" effect="dark" :content="content" placement="top">
<el-button size="small" type="text" icon="el-icon-info"></el-button>
</el-tooltip>
</template>
<script>
export default {
name: 'ToolTip',
props: {
content: {
type: String,
default: '',
},
},
}
</script>

@ -318,10 +318,9 @@ export default {
minWidth: 150,
type: 'html',
},
{ prop: 'end_time', label: '', width: 160, type: 'datetime' },
{ prop: 'reason', label: '', minWidth: 250 },
{ prop: 'remark', label: '', minWidth: 250 },
{ prop: 'start_time', label: '', width: 160, type: 'datetime' },
{ prop: 'end_time', label: '', width: 160, type: 'datetime' },
{ prop: 'created_at', label: '', width: 160, type: 'datetime' },
{ prop: 'updated_at', label: '', width: 160, type: 'datetime' },
]

@ -125,6 +125,75 @@ export const datetimePickerOptions = {
],
}
export const datetimePickerPunishmentOptions = {
shortcuts: [
{
text: '1',
onClick(picker) {
const end = new Date()
end.setTime(end.getTime() + 3600 * 1000)
picker.$emit('pick', end)
},
},
{
text: '12',
onClick(picker) {
const end = new Date()
end.setTime(end.getTime() + 3600 * 1000 * 12)
picker.$emit('pick', end)
},
},
{
text: '1',
onClick(picker) {
const end = new Date()
end.setTime(end.getTime() + 3600 * 1000 * 24)
picker.$emit('pick', end)
},
},
{
text: '2',
onClick(picker) {
const end = new Date()
end.setTime(end.getTime() + 3600 * 1000 * 24 * 2)
picker.$emit('pick', end)
},
},
{
text: '1',
onClick(picker) {
const end = new Date()
end.setTime(end.getTime() + 3600 * 1000 * 24 * 7)
picker.$emit('pick', end)
},
},
{
text: '1',
onClick(picker) {
const end = new Date()
end.setTime(end.getTime() + 3600 * 1000 * 24 * 30)
picker.$emit('pick', end)
},
},
{
text: '',
onClick(picker) {
const end = new Date()
end.setTime(end.getTime() + 3600 * 1000 * 24 * 183)
picker.$emit('pick', [start, end])
},
},
{
text: '1',
onClick(picker) {
const end = new Date()
end.setTime(end.getTime() + 3600 * 1000 * 24 * 365)
picker.$emit('pick', [start, end])
},
},
],
}
export const punishmentTypeOptions = [
{ label: '', value: 1, type: 'danger' },
{ label: '', value: 2, type: 'warning' },

Loading…
Cancel
Save