文章分类分组后端管理接口
parent
f7ad0d02f4
commit
17a4a998bf
|
@ -3,13 +3,8 @@
|
|||
<component name="ChangeListManager">
|
||||
<list default="true" id="7cf7b6b3-0082-44ef-bb0f-bfcc57e19eb1" name="Default Changelist" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/controller/file.go" beforeDir="false" afterPath="$PROJECT_DIR$/controller/file.go" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/controller/hardware.go" beforeDir="false" afterPath="$PROJECT_DIR$/controller/hardware.go" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/db/elasticEngine.go" beforeDir="false" afterPath="$PROJECT_DIR$/db/elasticEngine.go" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/main.go" beforeDir="false" afterPath="$PROJECT_DIR$/main.go" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/model/hardware.go" beforeDir="false" afterPath="$PROJECT_DIR$/model/hardware.go" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/model/blog.go" beforeDir="false" afterPath="$PROJECT_DIR$/model/blog.go" afterDir="false" />
|
||||
</list>
|
||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
|
@ -36,13 +31,19 @@
|
|||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="GOROOT" path="D:/programs/GOROOT" />
|
||||
<component name="GOROOT" path="$PROJECT_DIR$/../../../../Program Files/go" />
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="ProjectId" id="1OeBjD7R4KFQzfWAqpMf9jlmzxr" />
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
<property name="DefaultGoTemplateProperty" value="Go File" />
|
||||
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
|
||||
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
|
||||
<property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
|
||||
<property name="WebServerToolWindowFactoryState" value="false" />
|
||||
<property name="configurable.Global.GOPATH.is.expanded" value="true" />
|
||||
|
@ -50,20 +51,9 @@
|
|||
<property name="configurable.Project.GOPATH.is.expanded" value="true" />
|
||||
<property name="go.import.settings.migrated" value="true" />
|
||||
<property name="go.sdk.automatically.set" value="true" />
|
||||
<property name="last_opened_file_path" value="$PROJECT_DIR$/.." />
|
||||
<property name="settings.editor.selected.configurable" value="preferences.lookFeel" />
|
||||
</component>
|
||||
<component name="RunDashboard">
|
||||
<option name="ruleStates">
|
||||
<list>
|
||||
<RuleState>
|
||||
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
|
||||
</RuleState>
|
||||
<RuleState>
|
||||
<option name="name" value="StatusDashboardGroupingRule" />
|
||||
</RuleState>
|
||||
</list>
|
||||
</option>
|
||||
<property name="go.tried.to.enable.integration.vgo.integrator" value="true" />
|
||||
<property name="last_opened_file_path" value="$PROJECT_DIR$/../DroneIntegratedManagementServer" />
|
||||
<property name="settings.editor.selected.configurable" value="go.sdk" />
|
||||
</component>
|
||||
<component name="RunManager">
|
||||
<configuration name="background" type="GoApplicationRunConfiguration" factoryName="Go Application">
|
||||
|
@ -80,19 +70,72 @@
|
|||
</configuration>
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
<option name="version" value="1" />
|
||||
<option name="version" value="2" />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
<option name="TAB_STATES">
|
||||
<map>
|
||||
<entry key="MAIN">
|
||||
<value>
|
||||
<State>
|
||||
<option name="COLUMN_ORDER" />
|
||||
</State>
|
||||
<State />
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
<option name="oldMeFiltersMigrated" value="true" />
|
||||
</component>
|
||||
<component name="WindowStateProjectService">
|
||||
<state x="767" y="429" key="#Go_Modules" timestamp="1595431702688">
|
||||
<screen x="0" y="40" width="2048" height="1112" />
|
||||
</state>
|
||||
<state x="767" y="429" key="#Go_Modules/0.40.2048.1112@0.40.2048.1112" timestamp="1595431702688" />
|
||||
<state x="479" y="251" key="#com.intellij.execution.impl.EditConfigurationsDialog" timestamp="1595432372558">
|
||||
<screen x="0" y="40" width="2048" height="1112" />
|
||||
</state>
|
||||
<state x="479" y="251" key="#com.intellij.execution.impl.EditConfigurationsDialog/0.40.2048.1112@0.40.2048.1112" timestamp="1595432372558" />
|
||||
<state x="805" y="351" key="FileChooserDialogImpl" timestamp="1595431879732">
|
||||
<screen x="0" y="40" width="2048" height="1112" />
|
||||
</state>
|
||||
<state x="805" y="351" key="FileChooserDialogImpl/0.40.2048.1112@0.40.2048.1112" timestamp="1595431879732" />
|
||||
<state width="2005" height="376" key="GridCell.Tab.0.bottom" timestamp="1595433941254">
|
||||
<screen x="0" y="40" width="2048" height="1112" />
|
||||
</state>
|
||||
<state width="2005" height="376" key="GridCell.Tab.0.bottom/0.40.2048.1112@0.40.2048.1112" timestamp="1595433941254" />
|
||||
<state width="2005" height="376" key="GridCell.Tab.0.center" timestamp="1595433941254">
|
||||
<screen x="0" y="40" width="2048" height="1112" />
|
||||
</state>
|
||||
<state width="2005" height="376" key="GridCell.Tab.0.center/0.40.2048.1112@0.40.2048.1112" timestamp="1595433941254" />
|
||||
<state width="2005" height="376" key="GridCell.Tab.0.left" timestamp="1595433941254">
|
||||
<screen x="0" y="40" width="2048" height="1112" />
|
||||
</state>
|
||||
<state width="2005" height="376" key="GridCell.Tab.0.left/0.40.2048.1112@0.40.2048.1112" timestamp="1595433941254" />
|
||||
<state width="2005" height="376" key="GridCell.Tab.0.right" timestamp="1595433941254">
|
||||
<screen x="0" y="40" width="2048" height="1112" />
|
||||
</state>
|
||||
<state width="2005" height="376" key="GridCell.Tab.0.right/0.40.2048.1112@0.40.2048.1112" timestamp="1595433941254" />
|
||||
<state width="2005" height="376" key="GridCell.Tab.1.bottom" timestamp="1595433941254">
|
||||
<screen x="0" y="40" width="2048" height="1112" />
|
||||
</state>
|
||||
<state width="2005" height="376" key="GridCell.Tab.1.bottom/0.40.2048.1112@0.40.2048.1112" timestamp="1595433941254" />
|
||||
<state width="2005" height="376" key="GridCell.Tab.1.center" timestamp="1595433941254">
|
||||
<screen x="0" y="40" width="2048" height="1112" />
|
||||
</state>
|
||||
<state width="2005" height="376" key="GridCell.Tab.1.center/0.40.2048.1112@0.40.2048.1112" timestamp="1595433941254" />
|
||||
<state width="2005" height="376" key="GridCell.Tab.1.left" timestamp="1595433941254">
|
||||
<screen x="0" y="40" width="2048" height="1112" />
|
||||
</state>
|
||||
<state width="2005" height="376" key="GridCell.Tab.1.left/0.40.2048.1112@0.40.2048.1112" timestamp="1595433941254" />
|
||||
<state width="2005" height="376" key="GridCell.Tab.1.right" timestamp="1595433941254">
|
||||
<screen x="0" y="40" width="2048" height="1112" />
|
||||
</state>
|
||||
<state width="2005" height="376" key="GridCell.Tab.1.right/0.40.2048.1112@0.40.2048.1112" timestamp="1595433941254" />
|
||||
<state x="526" y="240" key="SettingsEditor" timestamp="1595432383541">
|
||||
<screen x="0" y="40" width="2048" height="1112" />
|
||||
</state>
|
||||
<state x="526" y="240" key="SettingsEditor/0.40.2048.1112@0.40.2048.1112" timestamp="1595432383541" />
|
||||
<state x="687" y="283" width="672" height="678" key="search.everywhere.popup" timestamp="1595431850294">
|
||||
<screen x="0" y="40" width="2048" height="1112" />
|
||||
</state>
|
||||
<state x="687" y="283" width="672" height="678" key="search.everywhere.popup/0.40.2048.1112@0.40.2048.1112" timestamp="1595431850294" />
|
||||
</component>
|
||||
</project>
|
|
@ -17,16 +17,30 @@ type Doc struct {
|
|||
IsPublic int `sql:"is_public" json:"is_public"`
|
||||
}
|
||||
|
||||
type DocGroup struct {
|
||||
Int int32 `sql:"int"`
|
||||
Name string `sql:"name"`
|
||||
}
|
||||
type ArticleType struct {
|
||||
Id int64 `sql:"id" json:"id"`
|
||||
Name string `sql:"type_name" json:"type_name"`
|
||||
Author string `sql:"author" json:"author"`
|
||||
Group int32 `sql:"group" json:"group"`
|
||||
GroupName string `json:"group_name"`
|
||||
}
|
||||
|
||||
func GetArticlesType() []ArticleType {
|
||||
ret := []ArticleType{}
|
||||
sql := fmt.Sprintf("select * from doc_type")
|
||||
e := db.GetBlogMysql().Query2(sql, &ret)
|
||||
for k,_ := range ret{
|
||||
group := []DocGroup{}
|
||||
sql = fmt.Sprintf("select * from doc_group where doc_group.int = %d",ret[k].Group)
|
||||
db.GetBlogMysql().Query2(sql, &group)
|
||||
if len(group) > 0{
|
||||
ret[k].GroupName = group[0].Name
|
||||
}
|
||||
}
|
||||
log.Print(ret)
|
||||
if nil != e {
|
||||
logs.Error(e.Error())
|
||||
|
|
Loading…
Reference in New Issue