Compare commits

...

1 Commits

Author SHA1 Message Date
96829ab082 Released first model in system scheme 2026-02-08 16:10:11 +03:00
5 changed files with 43 additions and 21 deletions

View File

@@ -1,6 +1,6 @@
<mxfile host="65bd71144e" pages="2">
<diagram name="db-scheme" id="omqtpuhYFdzVFIHnakk7">
<mxGraphModel dx="500" dy="291" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" background="none" math="0" shadow="0">
<mxGraphModel dx="702" dy="432" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" background="none" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
@@ -16,48 +16,44 @@
<mxCell id="5" value="&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;updated_at unixtime NOT NULL&lt;/span&gt;" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="2" vertex="1">
<mxGeometry y="90" width="140" height="30" as="geometry"/>
</mxCell>
<mxCell id="6" value="" style="endArrow=none;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" edge="1" parent="1" target="2">
<mxCell id="6" value="" style="endArrow=none;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" parent="1" target="2" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="414" y="180" as="sourcePoint"/>
<mxPoint x="370" y="180" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="8" value="users" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="8" value="users" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="180" y="230" width="140" height="210" as="geometry"/>
</mxCell>
<mxCell id="9" value="telegram_id BIGINT NOT NULL" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" vertex="1" parent="8">
<mxCell id="9" value="telegram_id BIGINT NOT NULL" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="8" vertex="1">
<mxGeometry y="30" width="140" height="30" as="geometry"/>
</mxCell>
<mxCell id="10" value="is_banned BOOLEAN NOT NULL DEFAULT FALSE" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" vertex="1" parent="8">
<mxCell id="10" value="is_banned BOOLEAN NOT NULL DEFAULT FALSE" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="8" vertex="1">
<mxGeometry y="60" width="140" height="50" as="geometry"/>
</mxCell>
<mxCell id="11" value="is_receive BOOLEAN NOT NULL DEFAULT FALSE" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" vertex="1" parent="8">
<mxCell id="11" value="is_receive BOOLEAN NOT NULL DEFAULT FALSE" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="8" vertex="1">
<mxGeometry y="110" width="140" height="50" as="geometry"/>
</mxCell>
<mxCell id="13" value="is_approved_statistics BOOLEAN NOT NULL DEFAULT FALSE" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" vertex="1" parent="8">
<mxCell id="13" value="is_approved_statistics BOOLEAN NOT NULL DEFAULT FALSE" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="8" vertex="1">
<mxGeometry y="160" width="140" height="50" as="geometry"/>
</mxCell>
<mxCell id="14" value="users_actions" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="430" y="290" width="140" height="140" as="geometry"/>
<mxCell id="14" value="users_actions" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="570" y="300" width="140" height="140" as="geometry"/>
</mxCell>
<mxCell id="15" value="user_id BIGINT NOT NULL" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" vertex="1" parent="14">
<mxCell id="15" value="user_id BIGINT NOT NULL" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="14" vertex="1">
<mxGeometry y="30" width="140" height="30" as="geometry"/>
</mxCell>
<mxCell id="16" value="chat_type ENUM(private, group) NOT NULL" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" vertex="1" parent="14">
<mxCell id="16" value="chat_type ENUM(private, group) NOT NULL" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="14" vertex="1">
<mxGeometry y="60" width="140" height="50" as="geometry"/>
</mxCell>
<mxCell id="17" value="Item 3" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" vertex="1" parent="14">
<mxCell id="17" value="Item 3" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="14" vertex="1">
<mxGeometry y="110" width="140" height="30" as="geometry"/>
</mxCell>
<mxCell id="18" value="" style="endArrow=classic;startArrow=classic;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;exitX=0.995;exitY=0.06;exitDx=0;exitDy=0;exitPerimeter=0;rounded=0;curved=0;" edge="1" parent="1" source="8" target="15">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="340" y="330" as="sourcePoint"/>
<mxPoint x="440" y="350" as="targetPoint"/>
<Array as="points">
<mxPoint x="370" y="243"/>
<mxPoint x="370" y="335"/>
</Array>
</mxGeometry>
<mxCell id="19" value="system" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="190" y="150" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="20" value="statistics" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="580" y="190" width="120" height="60" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>

View File

@@ -0,0 +1 @@
package main

9
src/models/base_model.go Normal file
View File

@@ -0,0 +1,9 @@
package models
import "time"
type BaseModel struct {
Id int64 `gorm:"column:id;autoIncrement;primaryKey;unique"`
CreatedAt time.Time `gorm:"column:created_at;autoCreateTime"`
UpdatedAt time.Time `gorm:"column:updated_at;autoUpdateTime"`
}

View File

@@ -0,0 +1,15 @@
package models
import "lirqetes.ru/thelanc3/laura-server/models"
type User struct {
models.BaseModel
TelegramId int64 `gorm:"column:telegram_id"`
IsBanned bool `gorm:"column:is_banned;default:false"`
IsReceive bool `gorm:"column:is_receive;default:false"`
IsApprovedStatistics bool `gorm:"column:is_approved_statistics;default:false"`
}
func (User) TableName() string {
return "system.users"
}

1
src/routes/init.go Normal file
View File

@@ -0,0 +1 @@
package routes