mirror of
https://github.com/m5stack/StackChan.git
synced 2026-04-27 19:12:40 +00:00
server code
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
/*
|
||||
SPDX-FileCopyrightText: 2026 M5Stack Technology CO LTD
|
||||
SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
package model
|
||||
|
||||
type DeviceInfo struct {
|
||||
Mac string `json:"mac" v:"required" description:"Mac address"`
|
||||
Name string `json:"name" v:"required" description:"Name"`
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// =================================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package do
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// Device is the golang structure of table device for DAO operations like Where/Data.
|
||||
type Device struct {
|
||||
g.Meta `orm:"table:device, do:true"`
|
||||
Mac any //
|
||||
Name any //
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
// =================================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package do
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// DeviceDance is the golang structure of table device_dance for DAO operations like Where/Data.
|
||||
type DeviceDance struct {
|
||||
g.Meta `orm:"table:device_dance, do:true"`
|
||||
Id any //
|
||||
Mac any // 设备MAC地址
|
||||
DanceIndex any // 舞蹈编号,初始为1~3,可扩展
|
||||
DanceData any // MotionData
|
||||
CreatedAt *gtime.Time //
|
||||
UpdatedAt *gtime.Time //
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// =================================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package do
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// DeviceFriend is the golang structure of table device_friend for DAO operations like Where/Data.
|
||||
type DeviceFriend struct {
|
||||
g.Meta `orm:"table:device_friend, do:true"`
|
||||
MacA any //
|
||||
MacB any //
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
// =================================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package do
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// DevicePost is the golang structure of table device_post for DAO operations like Where/Data.
|
||||
type DevicePost struct {
|
||||
g.Meta `orm:"table:device_post, do:true"`
|
||||
Id any //
|
||||
Mac any // 发帖设备MAC
|
||||
ContentText any // 文本内容
|
||||
ContentImage any // 图片URL
|
||||
CreatedAt *gtime.Time // 发帖时间
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
// =================================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package do
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// DevicePostComment is the golang structure of table device_post_comment for DAO operations like Where/Data.
|
||||
type DevicePostComment struct {
|
||||
g.Meta `orm:"table:device_post_comment, do:true"`
|
||||
Id any //
|
||||
PostId any // 帖子ID
|
||||
Mac any // 评论设备MAC
|
||||
Content any // 评论内容
|
||||
CreatedAt *gtime.Time // 评论时间
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// =================================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package do
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SqliteSequence is the golang structure of table sqlite_sequence for DAO operations like Where/Data.
|
||||
type SqliteSequence struct {
|
||||
g.Meta `orm:"table:sqlite_sequence, do:true"`
|
||||
Name any //
|
||||
Seq any //
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// =================================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package entity
|
||||
|
||||
// Device is the golang structure for table device.
|
||||
type Device struct {
|
||||
Mac string `json:"mac" orm:"mac" description:""` //
|
||||
Name string `json:"name" orm:"name" description:""` //
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
// =================================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package entity
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// DeviceDance is the golang structure for table device_dance.
|
||||
type DeviceDance struct {
|
||||
Id int64 `json:"id" orm:"id" description:""` //
|
||||
Mac string `json:"mac" orm:"mac" description:"设备MAC地址"` // 设备MAC地址
|
||||
DanceIndex int `json:"danceIndex" orm:"dance_index" description:"舞蹈编号,初始为1~3,可扩展"` // 舞蹈编号,初始为1~3,可扩展
|
||||
DanceData string `json:"danceData" orm:"dance_data" description:"MotionData"` // MotionData
|
||||
CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:""` //
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:""` //
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// =================================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package entity
|
||||
|
||||
// DeviceFriend is the golang structure for table device_friend.
|
||||
type DeviceFriend struct {
|
||||
MacA string `json:"macA" orm:"mac_a" description:""` //
|
||||
MacB string `json:"macB" orm:"mac_b" description:""` //
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
// =================================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package entity
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// DevicePost is the golang structure for table device_post.
|
||||
type DevicePost struct {
|
||||
Id int64 `json:"id" orm:"id" description:""` //
|
||||
Mac string `json:"mac" orm:"mac" description:"发帖设备MAC"` // 发帖设备MAC
|
||||
ContentText string `json:"contentText" orm:"content_text" description:"文本内容"` // 文本内容
|
||||
ContentImage string `json:"contentImage" orm:"content_image" description:"图片URL"` // 图片URL
|
||||
CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:"发帖时间"` // 发帖时间
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
// =================================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package entity
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// DevicePostComment is the golang structure for table device_post_comment.
|
||||
type DevicePostComment struct {
|
||||
Id int64 `json:"id" orm:"id" description:""` //
|
||||
PostId int64 `json:"postId" orm:"post_id" description:"帖子ID"` // 帖子ID
|
||||
Mac string `json:"mac" orm:"mac" description:"评论设备MAC"` // 评论设备MAC
|
||||
Content string `json:"content" orm:"content" description:"评论内容"` // 评论内容
|
||||
CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:"评论时间"` // 评论时间
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// =================================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package entity
|
||||
|
||||
// SqliteSequence is the golang structure for table sqlite_sequence.
|
||||
type SqliteSequence struct {
|
||||
Name string `json:"name" orm:"name" description:""` //
|
||||
Seq string `json:"seq" orm:"seq" description:""` //
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
SPDX-FileCopyrightText: 2026 M5Stack Technology CO LTD
|
||||
SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
package model
|
||||
|
||||
type ExpressionData struct {
|
||||
Type string `json:"type"`
|
||||
LeftEye ExpressionItem `json:"leftEye"`
|
||||
RightEye ExpressionItem `json:"rightEye"`
|
||||
Mouth ExpressionItem `json:"mouth"`
|
||||
}
|
||||
|
||||
type ExpressionItem struct {
|
||||
X int `json:"x"`
|
||||
Y int `json:"y"`
|
||||
Rotation int `json:"rotation"`
|
||||
Weight int `json:"weight"`
|
||||
Size int `json:"size"`
|
||||
}
|
||||
|
||||
type MotionData struct {
|
||||
Type string `json:"type"`
|
||||
PitchServo MotionDataItem `json:"pitchServo"`
|
||||
YawServo MotionDataItem `json:"yawServo"`
|
||||
}
|
||||
|
||||
type MotionDataItem struct {
|
||||
Angle int `json:"angle"`
|
||||
Speed int `json:"speed"`
|
||||
Rotate int `json:"rotate"`
|
||||
}
|
||||
|
||||
type DanceData struct {
|
||||
LeftEye ExpressionItem `json:"leftEye"`
|
||||
RightEye ExpressionItem `json:"rightEye"`
|
||||
Mouth ExpressionItem `json:"mouth"`
|
||||
PitchServo MotionDataItem `json:"pitchServo"`
|
||||
YawServo MotionDataItem `json:"yawServo"`
|
||||
DurationMs int `json:"durationMs"`
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
SPDX-FileCopyrightText: 2026 M5Stack Technology CO LTD
|
||||
SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
package model
|
||||
|
||||
import "github.com/gogf/gf/v2/os/gtime"
|
||||
|
||||
type Post struct {
|
||||
Id int64 `json:"id" orm:"id" description:"帖子ID"`
|
||||
Mac string `json:"mac" orm:"mac" description:"发帖设备MAC"`
|
||||
Name string `json:"name" orm:"name" description:"发帖设备名称"`
|
||||
ContentText string `json:"contentText" orm:"content_text" description:"文本内容"`
|
||||
ContentImage string `json:"contentImage" orm:"content_image" description:"图片URL"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:"发帖时间"`
|
||||
PostCommentList []*PostComment `json:"postCommentList" orm:"postCommentList" description:"评论"`
|
||||
}
|
||||
|
||||
type PostComment struct {
|
||||
Id int `json:"id" orm:"id" description:""` //
|
||||
PostId int `json:"postId" orm:"post_id" description:""` //
|
||||
Mac string `json:"mac" orm:"mac" description:""` //
|
||||
Name string `json:"name" orm:"name" description:""` //
|
||||
Content string `json:"content" orm:"content" description:""` //
|
||||
CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:""` //
|
||||
}
|
||||
Reference in New Issue
Block a user