master
hwf452 9 months ago
parent 919cce7fa2
commit c35017d748

@ -4,18 +4,8 @@
<option name="autoReloadType" value="ALL" /> <option name="autoReloadType" value="ALL" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="9f8c3ce4-c378-4191-b7a4-3d5acbc0ebbc" name="Changes" comment=""> <list default="true" id="9f8c3ce4-c378-4191-b7a4-3d5acbc0ebbc" name="Changes" comment="数据库改用orm框架 gorm">
<change afterPath="$PROJECT_DIR$/models/Order.go" afterDir="false" /> <change beforePath="$PROJECT_DIR$/mydb/initialize.go" beforeDir="false" afterPath="$PROJECT_DIR$/mydb/initialize.go" afterDir="false" />
<change afterPath="$PROJECT_DIR$/models/Product.go" afterDir="false" />
<change afterPath="$PROJECT_DIR$/models/User.go" afterDir="false" />
<change afterPath="$PROJECT_DIR$/mydb/initialize.go" afterDir="false" />
<change afterPath="$PROJECT_DIR$/utils/RandomNumber.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/go.mod" beforeDir="false" afterPath="$PROJECT_DIR$/go.mod" afterDir="false" />
<change beforePath="$PROJECT_DIR$/go.sum" beforeDir="false" afterPath="$PROJECT_DIR$/go.sum" afterDir="false" />
<change beforePath="$PROJECT_DIR$/install_go.sh" beforeDir="false" afterPath="$PROJECT_DIR$/install_go.sh" afterDir="false" />
<change beforePath="$PROJECT_DIR$/main.go" beforeDir="false" afterPath="$PROJECT_DIR$/main.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/models/Temperature.go" beforeDir="false" afterPath="$PROJECT_DIR$/models/Temperature.go" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -30,7 +20,20 @@
</option> </option>
</component> </component>
<component name="GOROOT" url="file://$USER_HOME$/sdk_go/go1.21.3" /> <component name="GOROOT" url="file://$USER_HOME$/sdk_go/go1.21.3" />
<component name="Git.Pull.Settings">
<option name="OPTIONS">
<set>
<option value="REBASE" />
</set>
</option>
</component>
<component name="Git.Settings"> <component name="Git.Settings">
<option name="PUSH_TAGS">
<GitPushTagMode>
<option name="argument" value="--follow-tags" />
<option name="title" value="Current Branch" />
</GitPushTagMode>
</option>
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" /> <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component> </component>
<component name="GoLibraries"> <component name="GoLibraries">
@ -43,6 +46,7 @@
<option name="showLibraryContents" value="true" /> <option name="showLibraryContents" value="true" />
</component> </component>
<component name="PropertiesComponent"> <component name="PropertiesComponent">
<property name="ASKED_ADD_EXTERNAL_FILES" value="true" />
<property name="DefaultGoTemplateProperty" value="Go File" /> <property name="DefaultGoTemplateProperty" value="Go File" />
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" /> <property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" /> <property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
@ -85,6 +89,11 @@
</map> </map>
</option> </option>
</component> </component>
<component name="VcsManagerConfiguration">
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
<MESSAGE value="数据库改用orm框架 gorm" />
<option name="LAST_COMMIT_MESSAGE" value="数据库改用orm框架 gorm" />
</component>
<component name="VgoProject"> <component name="VgoProject">
<integration-enabled>true</integration-enabled> <integration-enabled>true</integration-enabled>
</component> </component>

@ -17,8 +17,8 @@ var DB *gorm.DB
func initDatabase() { func initDatabase() {
//dsn := "root:Skyinno251,@tcp(192.168.2.18:3306)/gorm?charset=utf8mb4&parseTime=True&loc=Local" dsn := "root:Skyinno251,@tcp(192.168.2.18:3306)/gorm?charset=utf8mb4&parseTime=True&loc=Local"
dsn := "root:Skyinno251,@tcp(47.242.184.139:3306)/appserver?charset=utf8mb4&parseTime=True&loc=Local" //dsn := "root:Skyinno251,@tcp(47.242.184.139:3306)/appserver?charset=utf8mb4&parseTime=True&loc=Local"
db, err := gorm.Open(mysql.New(mysql.Config{ db, err := gorm.Open(mysql.New(mysql.Config{
DSN: dsn, // DSN data source name DSN: dsn, // DSN data source name

Loading…
Cancel
Save