Compare commits

..

16 Commits
a2 ... master

Author SHA1 Message Date
31353 f9b71548f6 再次修改 2023-12-24 21:31:05 +08:00
31353 4e2e86d5d3 第一次修改 2023-12-23 09:34:28 +08:00
guoxubao af7946ac09 Merge pull request 'xiaopang' (#1) from xiaopang into master
Reviewed-on: #1
2023-12-22 20:38:47 +08:00
31353 1b61bce8e1 xiaopang 2023-12-22 20:30:29 +08:00
31353 53b63e681e 合并后 2023-12-17 14:59:18 +08:00
31353 fe52549585 Merge remote-tracking branch 'origin/ftx'
# Conflicts:
#	.idea/encodings.xml
#	.idea/inspectionProfiles/Project_Default.xml
#	.idea/workspace.xml
#	bwie-common/src/main/java/com/bwie/common/domain/User.java
2023-12-17 14:52:54 +08:00
ftx d4235d79b7 病例增删改查 2023-12-17 14:33:15 +08:00
ftx 54908cdb36 病例增伤盖茶 2023-12-17 14:31:08 +08:00
ftx 606caba223 查询不了 2023-12-17 11:38:37 +08:00
31353 466be363e6 郝森 2023-12-17 11:16:08 +08:00
31353 9184f9129e Merge remote-tracking branch 'origin/a2'
# Conflicts:
#	.idea/encodings.xml
#	.idea/workspace.xml
#	bwie-modules/pom.xml
2023-12-17 11:05:06 +08:00
31353 55e7732de2 张耀东 2023-12-17 10:57:58 +08:00
31353 8dfb2e3fb2 Merge remote-tracking branch 'origin/a1'
# Conflicts:
#	.idea/encodings.xml
#	bwie-modules/pom.xml
2023-12-17 10:51:22 +08:00
Zhangyao cfdb39acde 健康教育 2023-12-17 10:43:45 +08:00
31353 ffd27b6729 登录 2023-12-17 10:40:17 +08:00
31353 d48f779680 登录 2023-12-16 13:55:24 +08:00
60 changed files with 2207 additions and 49 deletions

8
.idea/.gitignore vendored 100644
View File

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@ -7,10 +7,16 @@
<file url="file://$PROJECT_DIR$/bwie-common/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/bwie-gateway/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/bwie-gateway/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/bwie-modules/bwie-cases/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/bwie-modules/bwie-formation/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/bwie-modules/bwie-health/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/bwie-modules/bwie-user/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/bwie-modules/bwie-user/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/bwie-modules/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/bwie-modules/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
<file url="file://$APPLICATION_HOME_DIR$/jbr/bin/src/main/java" charset="UTF-8" />
<file url="file://$APPLICATION_HOME_DIR$/jbr/bin/src/main/resources" charset="UTF-8" />
</component>
</project>

View File

@ -0,0 +1,14 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="AliAccessStaticViaInstance" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="AliArrayNamingShouldHaveBracket" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="AliControlFlowStatementWithoutBraces" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="AliDeprecation" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="AliEqualsAvoidNull" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="AliLongLiteralsEndingWithLowercaseL" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="AliMissingOverrideAnnotation" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="AliWrapperTypeEquality" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="MapOrSetKeyShouldOverrideHashCodeEquals" enabled="true" level="WARNING" enabled_by_default="true" />
</profile>
</component>

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
<option value="$PROJECT_DIR$/bwie-modules/bwie-cases/pom.xml" />
</list>
</option>
</component>

View File

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.svg" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>

View File

@ -4,17 +4,7 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="4740c5ae-3633-49ee-af3c-6c838d096709" name="Changes" comment="">
<change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bwie-common/src/main/java/com/bwie/common/domain/Formation.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bwie-modules/bwie-formation/pom.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bwie-modules/bwie-formation/src/main/java/com/bwie/formaiton/FormaitonAppliaction.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bwie-modules/bwie-formation/src/main/java/com/bwie/formaiton/controller/FormationController.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bwie-modules/bwie-formation/src/main/java/com/bwie/formaiton/mapper/FormationMapper.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bwie-modules/bwie-formation/src/main/java/com/bwie/formaiton/service/FormationService.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bwie-modules/bwie-formation/src/main/java/com/bwie/formaiton/service/impl/FormationServiceImpl.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bwie-modules/bwie-formation/src/main/resources/bootstrap.yml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bwie-modules/bwie-formation/src/main/resources/mapper/FormationMapper.xml" afterDir="false" />
<list default="true" id="22f6834d-badb-4960-b20c-230dd62138eb" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/.idea/encodings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/encodings.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/bwie-modules/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/bwie-modules/pom.xml" afterDir="false" />
</list>
@ -35,40 +25,53 @@
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="ProjectId" id="2ZeGellpVQfTUIgDOaAVyh8QC8Z" />
<component name="ProjectColorInfo"><![CDATA[{
"associatedIndex": 1
}]]></component>
<component name="ProjectId" id="2ZeGwUKqC4hiI7DWBCSZlktoN5x" />
<component name="ProjectLevelVcsManager" settingsEditedManually="true">
<ConfirmationsSetting value="2" id="Add" />
</component>
<component name="ProjectViewState">
<option name="showLibraryContents" value="true" />
<option name="showVisibilityIcons" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"RequestMappingsPanelOrder0": "0",
"RequestMappingsPanelOrder1": "1",
"RequestMappingsPanelWidth0": "75",
"RequestMappingsPanelWidth1": "75",
"RunOnceActivity.OpenProjectViewOnStart": "true",
"RunOnceActivity.ShowReadmeOnStart": "true",
"SHARE_PROJECT_CONFIGURATION_FILES": "true",
"WebServerToolWindowFactoryState": "false",
"git-widget-placeholder": "master",
"jdk.selected.JAVA_MODULE": "1.8",
"last_opened_file_path": "D:/workspace/javaweb/JavaHeathl/bwie-modules/bwie-formation/src/main/java",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)",
"vue.rearranger.settings.migration": "true"
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;RequestMappingsPanelOrder0&quot;: &quot;0&quot;,
&quot;RequestMappingsPanelOrder1&quot;: &quot;1&quot;,
&quot;RequestMappingsPanelWidth0&quot;: &quot;75&quot;,
&quot;RequestMappingsPanelWidth1&quot;: &quot;75&quot;,
&quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;SHARE_PROJECT_CONFIGURATION_FILES&quot;: &quot;true&quot;,
&quot;WebServerToolWindowFactoryState&quot;: &quot;false&quot;,
&quot;git-widget-placeholder&quot;: &quot;master&quot;,
&quot;jdk.selected.JAVA_MODULE&quot;: &quot;1.8&quot;,
&quot;last_opened_file_path&quot;: &quot;Z:/JavaHeathl/bwie-modules/bwie-health/src/main/resources&quot;,
&quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
&quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
&quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
&quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
&quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
&quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
}
}]]></component>
}</component>
<component name="ReactorSettings">
<option name="notificationShown" value="true" />
</component>
<component name="RecentsManager">
<key name="CreateClassDialog.RecentsKey">
<recent name="com.bwie.health.mapper" />
<recent name="com.bwie.health.service" />
</key>
<key name="CopyFile.RECENT_KEYS">
<recent name="D:\workspace\javaweb\JavaHeathl\bwie-modules\bwie-formation\src\main\java" />
<recent name="D:\workspace\javaweb\JavaHeathl\bwie-modules\bwie-formation\src\main\resources" />
<recent name="Z:\JavaHeathl\bwie-modules\bwie-health\src\main\resources" />
<recent name="Z:\JavaHeathl\bwie-modules\bwie-health\src\main\java\com\bwie\health\service" />
<recent name="Z:\JavaHeathl\bwie-modules\bwie-health\src\main\java\com\bwie\health" />
</key>
<key name="CopyClassDialog.RECENTS_KEY">
<recent name="com.bwie.health.service.impl" />
</key>
</component>
<component name="RunDashboard">
@ -79,12 +82,12 @@
</option>
</component>
<component name="RunManager">
<configuration name="FormaitonAppliaction" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" temporary="true" nameIsGenerated="true">
<module name="bwie-formation" />
<option name="SPRING_BOOT_MAIN_CLASS" value="com.bwie.formaiton.FormaitonAppliaction" />
<configuration name="HealthApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" temporary="true" nameIsGenerated="true">
<module name="bwie-health" />
<option name="SPRING_BOOT_MAIN_CLASS" value="com.bwie.health.HealthApplication" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="com.bwie.formaiton.*" />
<option name="PATTERN" value="com.bwie.health.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
@ -94,7 +97,7 @@
</configuration>
<recent_temporary>
<list>
<item itemvalue="Spring Boot.FormaitonAppliaction" />
<item itemvalue="Spring Boot.HealthApplication" />
</list>
</recent_temporary>
</component>
@ -104,16 +107,28 @@
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="4740c5ae-3633-49ee-af3c-6c838d096709" name="Changes" comment="" />
<created>1702775230647</created>
<changelist id="22f6834d-badb-4960-b20c-230dd62138eb" name="Changes" comment="" />
<created>1702775369535</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1702775230647</updated>
<workItem from="1702775231994" duration="4891000" />
<updated>1702775369535</updated>
<workItem from="1702775370735" duration="3984000" />
<workItem from="1702795938832" duration="394000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
<entry key="MAIN">
<value>
<State />
</value>
</entry>
</map>
</option>
</component>
</project>

View File

@ -0,0 +1,18 @@
package com.bwie;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
/**
* @author gxb
* @description TODO
* @date 2023-12-16 12:19
*/
@SpringBootApplication
@EnableFeignClients
public class AuthAppliction {
public static void main(String[] args) {
SpringApplication.run(AuthAppliction.class,args);
}
}

View File

@ -0,0 +1,14 @@
package com.bwie.config;
import feign.Retryer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class FeignConfig {
@Bean
public Retryer retry(){
return new Retryer.Default(5000,30000,3);
}
}

View File

@ -0,0 +1,37 @@
package com.bwie.controller;
import com.bwie.common.domain.request.LoginRequest;
import com.bwie.common.result.Result;
import com.bwie.service.AuthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
/**
* @author gxb
* @description TODO
* @date 2023-12-08 20:10
*/
@RestController
public class AuthController {
@Autowired
private AuthService authService;
/**
*
*/
@PostMapping("/login")
public Result login(@RequestBody LoginRequest loginRequest){
return authService.login(loginRequest);
}
/**
*
*/
@GetMapping("/Info")
public Result Info(){
return authService.Info();
}
}

View File

@ -0,0 +1,21 @@
package com.bwie.feign;
import com.bwie.common.domain.User;
import com.bwie.common.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* @author gxb
* @description TODO
* @date 2023-12-08 20:10
*/
@FeignClient("bwie-user")
public interface AuthFeign {
/**
*
*/
@PostMapping("/findName")
public Result<User> findName(@RequestParam String username);
}

View File

@ -0,0 +1,16 @@
package com.bwie.service;
import com.bwie.common.domain.request.LoginRequest;
import com.bwie.common.result.Result;
/**
* @author gxb
* @description TODO
* @date 2023-12-08 20:10
*/
public interface AuthService {
Result login(LoginRequest loginRequest);
Result Info();
}

View File

@ -0,0 +1,112 @@
package com.bwie.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.nacos.common.utils.UuidUtils;
import com.bwie.common.constants.JwtConstants;
import com.bwie.common.constants.TokenConstants;
import com.bwie.common.domain.User;
import com.bwie.common.domain.request.LoginRequest;
import com.bwie.common.domain.response.JwtResponse;
import com.bwie.common.result.Result;
import com.bwie.common.utils.JwtUtils;
import com.bwie.feign.AuthFeign;
import com.bwie.service.AuthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.concurrent.TimeUnit;
/**
* @author gxb
* @description TODO
* @date 2023-12-08 20:11
*/
@Service
public class AuthServicelmpl implements AuthService {
@Autowired
private AuthFeign authFeign;
@Autowired
private RedisTemplate<String,String> redisTemplate;
@Autowired
private HttpServletRequest request;
/**
*
* @param loginRequest
* @return
*/
@Override
public Result login(LoginRequest loginRequest) {
/**
*
*/
Boolean userPwd = this.isUserPwd(loginRequest.getPassword());
if (!userPwd){
return Result.error("密码由不超过16位的数字、英文、下划线组成");
}
/**
*
*/
User user = authFeign.findName(loginRequest.getUsername()).getData();
if (null==user){
return Result.error("用户名不存在,请先注册");
}
if (!user.getPassword().equals(loginRequest.getPassword())){
return Result.error("密码输入错误,请重新输入");
}
Integer role = user.getRole();
Integer role1 = loginRequest.getRole();
int a = role;
int b = role1;
boolean c = a == b;
if (!c){
return Result.error("登录身份选择错误");
}
JwtResponse token = this.getToken(user);
if (1==user.getRole()){
return Result.success(token,"医生登录成功");
}
return Result.success(token,"病人(家属)登录成功");
}
@Override
public Result Info() {
String token = request.getHeader("token");
String userKey = JwtUtils.getUserKey(token);
String s = redisTemplate.opsForValue().get(TokenConstants.LOGIN_TOKEN_KEY + userKey);
User user = JSON.parseObject(s, User.class);
return Result.success(user,"当前登录人");
}
//生成token
private JwtResponse getToken(User user){
HashMap<String, Object> map = new HashMap<>();
String userKey = UuidUtils.generateUuid().replaceAll("-", "");
map.put(JwtConstants.USER_KEY,userKey);
String token = JwtUtils.createToken(map);
redisTemplate.opsForValue().set(TokenConstants.LOGIN_TOKEN_KEY+userKey,
JSON.toJSONString(user),15, TimeUnit.MINUTES);
return new JwtResponse(token);
}
//编号必填且必须是6位数字
private Boolean isUserBh(String userBh){
String str = "^\\d{6}$";
return userBh.matches(str);
}
//密码必填由不超过16位的数字、英文、下划线组成
private Boolean isUserPwd(String userPwd){
String str = "^[\\w]{1,16}$";
return userPwd.matches(str);
}
//手机号验证
private Boolean isPhone(String userPhone){
String str= "^1[3-9]\\d{9}$";
return userPhone.matches(str);
}
}

View File

@ -0,0 +1,12 @@
<dependencies>
<!-- 项目公共 依赖 -->
<dependency>
<groupId>com.bwie</groupId>
<artifactId>bwie-common</artifactId>
</dependency>
<!-- SpringBoot Web-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>

View File

@ -0,0 +1,22 @@
package com.bwie.common.domain;
import lombok.Data;
import java.util.Date;
/**
* @author Handsome boy
* @Package com.bwie.common.domain
* @date 2023/12/8 20:22
*/
@Data
public class Case {
private Integer caseId;
private Integer userId;
private String caseName;
private String caseTime;
private String caseMessage;
}

View File

@ -0,0 +1,18 @@
package com.bwie.common.domain;
import lombok.Data;
/**
* @author Handsome boy
* @Package com.bwie.common.domain
* @date 2023/12/16 11:51
*/
@Data
public class CaseRequest {
private Integer pageSize;
private Integer pageNum;
private Integer roleId;
private Integer userId;
}

View File

@ -0,0 +1,24 @@
package com.bwie.common.domain;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Health{
private Integer healthId;
private String healthTitle;
private String healthContent;
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date healthDate;
private Integer userId;
private Integer isDele;
private Integer pageNum;
private Integer pageSize;
}

View File

@ -0,0 +1,32 @@
package com.bwie.common.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
* @author gxb
* @description TODO
* @date 2023-12-22 20:28
*/
@Data
public class Manage {
// 管理员ID
private Integer manageId;
// 案件ID
private Integer caseId;
// 问题ID
private Integer id;
// 案件名称
private String caseName;
// 案件时间
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date caseTime;
// 案件信息
private String caseMessage;
// 用户名
private String username;
}

View File

@ -0,0 +1,20 @@
package com.bwie.common.domain;
import lombok.Data;
/**
* @author gxb
* @description TODO
* @date 2023-12-08 20:47
*/
@Data
public class Sign {
//名称
private String username;
//密码
private String password;
// 1 - 管理员 2 - 用户
private Integer role;
private String phone;
}

View File

@ -0,0 +1,33 @@
package com.bwie.common.domain;
import lombok.Data;
/**
* @author gxb
* @description TODO
* @date 2023-12-16 11:43
*/
@Data
public class User {
/**
* Id
*/
private Integer id;
/**
*
*/
private String username;
/**
*
*/
private String password;
/**
* 1 - 2-
*/
private Integer role;
/**
*
*/
private String phone;
}

View File

@ -0,0 +1,15 @@
package com.bwie.common.domain.request;
import lombok.Data;
/**
* @author gxb
* @description TODO
* @date 2023-12-16 11:44
*/
@Data
public class LoginRequest {
private String username;
private String password;
private Integer role;
}

View File

@ -0,0 +1,18 @@
package com.bwie.common.domain.request;
import lombok.Data;
/**
* @author gxb
* @description TODO
* @date 2023-12-16 13:19
*/
@Data
public class Retri {
/**
*
*/
private String phone;
private Integer role;
}

View File

@ -0,0 +1,16 @@
package com.bwie.common.domain.response;
import lombok.AllArgsConstructor;
import lombok.Data;
/**
* @author gxb
* @description TODO
* @date 2023-12-08 20:20
*/
@Data
@AllArgsConstructor
public class JwtResponse {
private String token;
}

View File

@ -9,8 +9,8 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
* @date 2023-12-16 8:35
*/
@SpringBootApplication
public class GatewayAppliction {
public class GatewayApplication {
public static void main(String[] args) {
SpringApplication.run(GatewayAppliction.class,args);
SpringApplication.run(GatewayApplication.class,args);
}
}
}

View File

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.bwie</groupId>
<artifactId>bwie-modules</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>bwie-cases</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- 系统公共 依赖 -->
<dependency>
<groupId>com.bwie</groupId>
<artifactId>bwie-common</artifactId>
</dependency>
<!-- SpringBoot Web-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- Druid -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.2.8</version>
</dependency>
<!-- Mysql Connector -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!-- Mybatis 依赖配置 -->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.2.2</version>
</dependency>
<!-- Pagehelper -->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.4.1</version>
</dependency>
<!-- test -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.tobato</groupId>
<artifactId>fastdfs-client</artifactId>
<version>1.26.5</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,16 @@
package com.bwie.xxxxxx;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* @author Handsome boy
* @Package com.bwie.xxxxxx
* @date 2023/12/16 12:02
*/
@SpringBootApplication
public class CasesApplication {
public static void main(String[] args) {
SpringApplication.run(CasesApplication.class);
}
}

View File

@ -0,0 +1,73 @@
package com.bwie.xxxxxx.controller;
import com.bwie.common.domain.Case;
import com.bwie.common.domain.CaseRequest;
import com.bwie.common.result.PageResult;
import com.bwie.common.result.Result;
import com.bwie.xxxxxx.service.CaseService;
import lombok.extern.log4j.Log4j2;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @author Handsome boy
* @Package com.bwie.xxxxxx.controller
* @date 2023/12/8 20:21
*/
@RestController
@Log4j2
public class CaseController {
final CaseService caseService;
public CaseController(CaseService caseService) {
this.caseService = caseService;
}
/**
*
*
* @param cases;
*/
@PostMapping("/case")
public Result<Object> insertCase(@RequestBody Case cases) {
log.info(cases);
return caseService.insertCase(cases);
}
/**
*
*
* @param caseId;
*/
@DeleteMapping("/case/{caseId}")
public Result<Object> deleteCase(@PathVariable Integer caseId) {
return caseService.deleteCase(caseId);
}
/**
*
*
* @param cases;
*/
@PutMapping("/case")
public Result<Object> updateCase(@RequestBody Case cases) {
return caseService.updateCase(cases);
}
/**
*
*
* @return ;
*/
@GetMapping("/case")
public Result<PageResult<Case>> selCase(@RequestBody CaseRequest caseRequest) {
System.out.println(caseRequest + "---------");
return caseService.selCase(caseRequest);
}
}

View File

@ -0,0 +1,44 @@
package com.bwie.xxxxxx.mapper;
import com.bwie.common.domain.Case;
import com.bwie.common.domain.CaseRequest;
import com.bwie.common.result.Result;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @author Handsome boy
* @Package com.bwie.xxxxxx.mapper
* @date 2023/12/8 20:21
*/
@Mapper
public interface CaseMapper {
/**
*
* @return ;
* @param cases;
*/
int insertCase(Case cases);
/**
*
* @return ;
* @param caseId;
*/
int deleteCase(Integer caseId);
/**
*
* @param cases ;
* @return ;
*/
int updateCase(Case cases);
/**
*
* @param caseRequest;
* @return ;
*/
List<Case> selCase(CaseRequest caseRequest);
}

View File

@ -0,0 +1,45 @@
package com.bwie.xxxxxx.service;
import com.bwie.common.domain.Case;
import com.bwie.common.domain.CaseRequest;
import com.bwie.common.result.PageResult;
import com.bwie.common.result.Result;
import java.util.List;
/**
* @author Handsome boy
* @Package com.bwie.xxxxxx.service
* @date 2023/12/8 20:21
*/
public interface CaseService {
/**
*
* @return ;
* @param cases;
*/
Result<Object> insertCase(Case cases);
/**
*
* @return ;
* @param caseId;
*/
Result<Object> deleteCase(Integer caseId);
/**
*
* @return ;
* @param cases;
*/
Result<Object> updateCase(Case cases);
/**
*
* @param caseRequest;
* @return ;
*/
Result<PageResult<Case>> selCase(CaseRequest caseRequest);
}

View File

@ -0,0 +1,138 @@
package com.bwie.xxxxxx.service.impl;
import com.alibaba.fastjson.JSON;
import com.bwie.common.constants.TokenConstants;
import com.bwie.common.domain.Case;
import com.bwie.common.domain.CaseRequest;
import com.bwie.common.domain.User;
import com.bwie.common.result.PageResult;
import com.bwie.common.result.Result;
import com.bwie.common.utils.JwtUtils;
import com.bwie.xxxxxx.mapper.CaseMapper;
import com.bwie.xxxxxx.service.CaseService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* @author Handsome boy
* @Package com.bwie.xxxxxx.service.impl
* @date 2023/12/8 20:21
*/
@Service
public class CaseServiceImpl implements CaseService {
final CaseMapper caseMapper;
final HttpServletRequest request;
final RedisTemplate<String, String> redisTemplate;
public CaseServiceImpl(CaseMapper caseMapper, HttpServletRequest request, RedisTemplate<String, String> redisTemplate) {
this.caseMapper = caseMapper;
this.request = request;
this.redisTemplate = redisTemplate;
}
/**
*
*
* @param cases;
*/
@Override
public Result<Object> insertCase(Case cases) {
int row;
try {
// 调用caseMapper的insertCase方法插入cases
row = caseMapper.insertCase(cases);
} catch (Exception e) {
// 抛出运行时异常
throw new RuntimeException(e);
}
// 如果row等于0抛出非法访问错误
if (row == 0) {
throw new IllegalAccessError("添加异常");
}
// 返回添加病例成功的结果
return Result.success("添加病例成功");
}
/**
*
*
* @param caseId;
*/
@Override
public Result<Object> deleteCase(Integer caseId) {
int row;
try {
row = caseMapper.deleteCase(caseId);
} catch (Exception e) {
throw new RuntimeException(e);
}
if (row == 0) {
throw new IllegalAccessError("删除异常");
}
return Result.success("删除病例成功");
}
/**
*
*
* @param cases;
*/
@Override
public Result<Object> updateCase(Case cases) {
int row;
try {
row = caseMapper.updateCase(cases);
} catch (Exception e) {
throw new RuntimeException(e);
}
if (row == 0) {
throw new IllegalAccessError("修改异常");
}
return Result.success("修改病例成功");
}
@Override
public Result<PageResult<Case>> selCase(CaseRequest caseRequest) {
// 调用PageHelper的startPage方法传入当前页码和每页条数
PageHelper.startPage(caseRequest.getPageNum(), caseRequest.getPageSize());
//获取登录人信息
// User user = getToken();
// if (user == null){
// return Result.error("未登录");
// }
// caseRequest.setRoleId(user.getRole());
// caseRequest.setUserId(user.getId());
// 调用caseMapper的selCase方法传入CaseRequest参数
List<Case> list = caseMapper.selCase(caseRequest);
// 调用PageInfo的构造方法传入list参数
PageInfo<Case> page = new PageInfo<>(list);
// 调用Result的success方法传入PageResult.toPageResult方法传入page.getTotal()和list参数
return PageResult.toResult(page.getTotal() ,list);
}
/**
*
*
* @return ;
*/
private User getToken() {
//获取token
String token = request.getHeader("token");
//获取用户key
String userKey = JwtUtils.getUserKey(token);
//从redis中获取用户信息
String s = redisTemplate.opsForValue().get(TokenConstants.LOGIN_TOKEN_KEY + userKey);
//将用户信息转换为User对象
return JSON.parseObject(s, User.class);
}
}

View File

@ -0,0 +1,55 @@
package com.bwie.xxxxxx.util;
import com.github.tobato.fastdfs.domain.fdfs.StorePath;
import com.github.tobato.fastdfs.service.FastFileStorageClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
/**
* @BelongsProject: 0107day02
* @BelongsPackage: com.bw.config
* @Author: zhupengfei
* @CreateTime: 2023-02-01 08:52
*/
@Component
public class FastUtil {
private static final Logger log = LoggerFactory.getLogger(FastUtil.class);
@Resource
private FastFileStorageClient storageClient ;
/**
*
*/
public String upload(MultipartFile multipartFile) throws Exception{
String originalFilename = multipartFile.getOriginalFilename().
substring(multipartFile.getOriginalFilename().
lastIndexOf(".") + 1);
StorePath storePath = this.storageClient.uploadImageAndCrtThumbImage(
multipartFile.getInputStream(),
multipartFile.getSize(),originalFilename , null);
return storePath.getFullPath() ;
}
/**
*
*/
public String deleteFile(String fileUrl) {
if (StringUtils.isEmpty(fileUrl)) {
log.info("fileUrl == >>文件路径为空...");
return "文件路径不能为空";
}
try {
StorePath storePath = StorePath.parseFromUrl(fileUrl);
storageClient.deleteFile(storePath.getGroup(), storePath.getPath());
} catch (Exception e) {
log.error(e.getMessage());
}
return "删除成功";
}
}

View File

@ -0,0 +1,41 @@
# Tomcat
server:
port: 9099
# Spring
spring:
main:
allow-circular-references: true
jackson:
date-format: yyyy-MM-dd HH:mm:ss
time-zone: GMT+8
application:
# 应用名称
name: bwie-case
profiles:
# 环境配置
active: dev
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: 43.143.161.183:8848
config:
# 配置中心地址
server-addr: 43.143.161.183:8848
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
fdfs:
so-timeout: 1500 # socket 连接时长
connect-timeout: 600 # 连接 tracker 服务器超时时长
# 这两个是你服务器的 IP 地址,注意 23000 端口也要打开阿里云服务器记得配置安全组。tracker 要和 stroage 服务进行交流
tracker-list: 43.143.161.183:22122
web-server-url: 43.143.161.183:8888
pool:
jmx-enabled: false
# 生成缩略图
thumb-image:
height: 500
width: 500

View File

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.bwie.xxxxxx.mapper.CaseMapper">
<!-- 添加病历表 -->
<insert id="insertCase">
insert into cases
values (null, #{caseName}, #{caseMessage}, #{caseTime}, #{userId})
</insert>
<!-- 修改病历表 -->
<update id="updateCase">
update cases
set case_name=#{caseName},
case_message=#{caseMessage},
case_Time=#{caseTime}
where case_id = #{caseId}
</update>
<!-- 删除病例表 -->
<delete id="deleteCase">
delete
from cases
where case_id = #{caseId}
</delete>
<!-- 查询病历表 -->
<select id="selCase" resultType="com.bwie.common.domain.Case">
select *
from cases
<where>
<if test="2==roleId">
case.user_id = #{userId}
</if>
</where>
</select>
</mapper>

View File

@ -1,12 +1,18 @@
package com.bwie.formaiton.service.impl;
import com.alibaba.fastjson.JSON;
import com.bwie.common.constants.TokenConstants;
import com.bwie.common.domain.Formation;
import com.bwie.common.domain.User;
import com.bwie.common.result.Result;
import com.bwie.common.utils.JwtUtils;
import com.bwie.formaiton.mapper.FormationMapper;
import com.bwie.formaiton.service.FormationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
@Service
@ -14,15 +20,35 @@ public class FormationServiceImpl implements FormationService {
@Autowired
private FormationMapper formationMapper;
@Override
@Autowired
private StringRedisTemplate redisTemplate;
@Autowired
private HttpServletRequest request;
@Override
public Result<List<Formation>> list() {
// 调用formationMapper的list方法获取Formation列表
List<Formation> list = formationMapper.list();
// 返回成功结果包含Formation列表
return Result.success(list);
}
@Override
@Override
public Result<Integer> insert(Formation formation) {
// 获取token
String token = request.getHeader(TokenConstants.TOKEN);
// 获取用户key
String userKey = JwtUtils.getUserKey(token);
// 从redis中获取用户信息
String s = redisTemplate.opsForValue().get(TokenConstants.LOGIN_TOKEN_KEY + userKey);
// 将用户信息转换成User对象
User user = JSON.parseObject(s, User.class);
// 将用户信息设置到formation对象中
formation.setUserId(user.getId());
formation.setUserName(user.getUsername());
formation.setUserPwd(user.getPassword());
// 插入formation表
Integer i = formationMapper.insert(formation);
// 返回插入的条数
return Result.success(i);
}
}

View File

@ -0,0 +1,38 @@
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr
### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
### Mac OS ###
.DS_Store

View File

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.bwie</groupId>
<artifactId>bwie-modules</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>bwie-health</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- 系统公共 依赖 -->
<dependency>
<groupId>com.bwie</groupId>
<artifactId>bwie-common</artifactId>
</dependency>
<!-- SpringBoot Web-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- Druid -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.2.8</version>
</dependency>
<!-- Mysql Connector -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!-- Mybatis 依赖配置 -->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.2.2</version>
</dependency>
<!-- Pagehelper -->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.4.1</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,13 @@
package com.bwie.health;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
@SpringBootApplication
@EnableDiscoveryClient
public class HealthApplication{
public static void main(String[] args) {
SpringApplication.run(HealthApplication.class,args);
}
}

View File

@ -0,0 +1,38 @@
package com.bwie.health.controller;
import com.bwie.common.domain.Health;
import com.bwie.common.result.Result;
import com.bwie.health.service.HealthService;
import com.github.pagehelper.PageInfo;
import io.lettuce.core.pubsub.RedisPubSubListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/health")
public class HealthController{
@Autowired
private HealthService healthService;
@PostMapping("/list")
public Result<PageInfo<Health>> list(@RequestBody Health health){
return healthService.list(health);
}
@PostMapping("/addHealth")
public Result<Integer> addHealth(@RequestBody Health health){
return healthService.addHealth(health);
}
@PostMapping("/updateHealth")
public Result<Integer> updateHealth(@RequestBody Health health){
return healthService.updateHealth(health);
}
@PostMapping("/deleteHealth")
public Result<Integer> deleteHealth(@RequestParam String healthId){
return healthService.deleteHealth(healthId);
}
}

View File

@ -0,0 +1,18 @@
package com.bwie.health.mapper;
import com.bwie.common.domain.Health;
import com.bwie.common.result.Result;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface HealthMapper{
List<Health> list(Health health);
Integer addHealth(Health health);
Integer updateHealth(Health health);
Integer deleteHealth(String healthId);
}

View File

@ -0,0 +1,15 @@
package com.bwie.health.service;
import com.bwie.common.domain.Health;
import com.bwie.common.result.Result;
import com.github.pagehelper.PageInfo;
public interface HealthService{
Result<PageInfo<Health>> list(Health health);
Result<Integer> addHealth(Health health);
Result<Integer> updateHealth(Health health);
Result<Integer> deleteHealth(String healthId);
}

View File

@ -0,0 +1,76 @@
package com.bwie.health.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.bwie.common.constants.TokenConstants;
import com.bwie.common.domain.Health;
import com.bwie.common.domain.User;
import com.bwie.common.result.Result;
import com.bwie.common.utils.JwtUtils;
import com.bwie.health.mapper.HealthMapper;
import com.bwie.health.service.HealthService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
@Service
public class HealthServiceImpl implements HealthService{
@Autowired
private HealthMapper healthMapper;
@Autowired
private RedisTemplate<String,String> redisTemplate;
@Autowired
private HttpServletRequest request;
/*查看内容*/
@Override
public Result<PageInfo<Health>> list(Health health) {
// 调用PageHelper的startPage方法传入当前页码和每页条数
PageHelper.startPage(health.getPageNum(),health.getPageSize());
// 调用healthMapper的list方法传入health参数
List<Health> list = healthMapper.list(health);
// 创建PageInfo对象传入list
PageInfo<Health> info = new PageInfo<>(list);
// 返回Result.success方法传入info
return Result.success(info);
}
/*健康教育信息录入*/
@Override
public Result<Integer> addHealth(Health health) {
//获取token
String token1 = request.getHeader("token");
//根据token获取用户key
String userKey = JwtUtils.getUserKey(token1);
//根据用户key获取token
String token = redisTemplate.opsForValue().get(TokenConstants.LOGIN_TOKEN_KEY+userKey);
//根据token解析出用户信息
User o = JSONObject.parseObject(token, User.class);
//将用户信息设置到health中
health.setUserId(o.getId());
//调用healthMapper的addHealth方法添加health
Integer i = healthMapper.addHealth(health);
//根据返回结果返回对应信息
return Result.success(i,i>0?"录入成功":"录入失败");
}
/*健康教育记录修改*/
@Override
public Result<Integer> updateHealth(Health health) {
Integer i = healthMapper.updateHealth(health);
return Result.success(i,i>0?"修改成功":"修改失败");
}
/*健康教育记录删除*/
@Override
public Result<Integer> deleteHealth(String healthId) {
Integer i = healthMapper.deleteHealth(healthId);
return Result.success(i,i>0?"删除成功":"删除失败");
}
}

View File

@ -0,0 +1,43 @@
# Tomcat
server:
port: 9003
# Spring
spring:
main:
allow-circular-references: true
jackson:
date-format: yyyy-MM-dd HH:mm:ss
time-zone: GMT+8
application:
# 应用名称
name: bwie-health
profiles:
# 环境配置
active: dev
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: 43.143.161.183:8848
config:
# 配置中心地址
server-addr: 43.143.161.183:8848
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
fdfs:
so-timeout: 1500 # socket 连接时长
connect-timeout: 600 # 连接 tracker 服务器超时时长
# 这两个是你服务器的 IP 地址,注意 23000 端口也要打开阿里云服务器记得配置安全组。tracker 要和 stroage 服务进行交流
tracker-list: 124.221.211.96:22122
web-server-url: 124.221.211.96:8888
pool:
jmx-enabled: false
# 生成缩略图
thumb-image:
height: 500
width: 500

View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.bwie.health.mapper.HealthMapper">
<insert id="addHealth">
INSERT INTO `health`.`health`
(`health_title`, `health_content`, `health_date`, `user_id`, `is_dele`)
VALUES
(#{healthTitle}, #{healthContent}, now(), #{userId}, 1)
</insert>
<update id="updateHealth">
UPDATE `health`.`health` SET
`health_title` = #{healthTitle},
`health_content` = #{healthContent},
`health_date` = #{healthDate},
`user_id` = 1,
`is_dele` = 1
WHERE `health_id` = #{healthId}
</update>
<update id="deleteHealth">
</update>
<select id="list" resultType="com.bwie.common.domain.Health">
select * from health h left join user u on h.user_id=u.id
<!-- <where>-->
<!-- <if test="">-->
<!-- </if>-->
<!-- </where>-->
</select>
</mapper>

View File

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.bwie</groupId>
<artifactId>bwie-modules</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>bwie-manage</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- 系统公共 依赖 -->
<dependency>
<groupId>com.bwie</groupId>
<artifactId>bwie-common</artifactId>
</dependency>
<!-- SpringBoot Web-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- Druid -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.2.8</version>
</dependency>
<!-- Mysql Connector -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!-- Mybatis 依赖配置 -->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.2.2</version>
</dependency>
<!-- Pagehelper -->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.4.1</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,11 @@
package com.bwie.manage;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class ManageApp {
public static void main(String[] args) {
SpringApplication.run(ManageApp.class);
}
}

View File

@ -0,0 +1,36 @@
package com.bwie.manage.controller;
import com.bwie.common.domain.Case;
import com.bwie.common.domain.Manage;
import com.bwie.common.result.Result;
import com.bwie.manage.service.ManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class ManageController {
@Autowired
private ManageService manageService;
@PostMapping("/list")
public Result list(){
return manageService.list();
}
@PostMapping("/add")
public Result add(@RequestBody Manage manage){
return manageService.add(manage);
}
@PostMapping("/upd")
public Result upd(@RequestBody Manage manage){
return manageService.upd(manage);
}
@PostMapping("/del")
public Result del(@RequestParam Integer manageId){
return manageService.del(manageId);
}
}

View File

@ -0,0 +1,22 @@
package com.bwie.manage.mapper;
import com.bwie.common.domain.Manage;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
import java.util.List;
@Mapper
@Component
public interface ManageMapper {
List<Manage> list();
Integer add(Manage manage);
Integer upd(Manage manage);
Integer del(Integer manageId);
Manage findAll(Manage manage);
}

View File

@ -0,0 +1,14 @@
package com.bwie.manage.service;
import com.bwie.common.domain.Manage;
import com.bwie.common.result.Result;
public interface ManageService {
Result list();
Result add(Manage manage);
Result upd(Manage manage);
Result del(Integer manageId);
}

View File

@ -0,0 +1,60 @@
package com.bwie.manage.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.bwie.common.constants.TokenConstants;
import com.bwie.common.domain.Manage;
import com.bwie.common.domain.User;
import com.bwie.common.result.Result;
import com.bwie.common.utils.JwtUtils;
import com.bwie.manage.mapper.ManageMapper;
import com.bwie.manage.service.ManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
@Service
public class ManageServiceCs implements ManageService {
@Autowired
private ManageMapper manageMapper;
@Autowired
private RedisTemplate<String ,String > redisTemplate;
@Autowired
private HttpServletRequest request;
@Override
public Result list() {
List<Manage> list = manageMapper.list();
return Result.success(list,"列表");
}
@Override
public Result add(Manage manage) {
String token = request.getHeader("token");
String userKey = JwtUtils.getUserKey(token);
String s = redisTemplate.opsForValue().get(TokenConstants.LOGIN_TOKEN_KEY + userKey);
User user = JSONObject.parseObject(s, User.class);
manage.setId(user.getId());
Manage all = manageMapper.findAll(manage);
if (all!=null){
return Result.error("存在此病人不能添加");
}
Integer add=manageMapper.add(manage);
return Result.success(add>0?200:500,add>0?"添加成功":"添加失败");
}
@Override
public Result upd(Manage manage) {
Integer upd=manageMapper.upd(manage);
return Result.success(upd>0?200:500,upd>0?"添加成功":"添加失败");
}
@Override
public Result del(Integer manageId) {
Integer del=manageMapper.del(manageId);
return Result.success(del>0?200:500,del>0?"删除成功":"删除失败");
}
}

View File

@ -0,0 +1,29 @@
# Tomcat
server:
port: 9005
# Spring
spring:
main:
allow-circular-references: true
jackson:
date-format: yyyy-MM-dd HH:mm:ss
time-zone: GMT+8
application:
# 应用名称
name: bwie-manage
profiles:
# 环境配置
active: dev
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: 43.143.161.183:8848
config:
# 配置中心地址
server-addr: 43.143.161.183:8848
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.bwie.manage.mapper.ManageMapper">
<insert id="add">
INSERT INTO `health`.`t_manage` (`case_id`, `id`)
VALUES (#{caseId}, #{id});
</insert>
<update id="upd">
UPDATE `health`.`t_manage` SET `case_id` = #{caseId},
`id` = #{id}
WHERE `manage_id` = #{manageId};
</update>
<delete id="del">
delete from t_manage where manage_id=#{manageId}
</delete>
<select id="list" resultType="com.bwie.common.domain.Manage">
select m.*,c.case_name,c.case_time,c.case_message,u.username from t_manage m left join cases c on m.case_id=c.case_id
left join user u on m.id=u.id
</select>
<select id="findAll" resultType="com.bwie.common.domain.Manage">
select *from t_manage where case_id=#{caseId} and id=#{id}
</select>
</mapper>

View File

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.bwie</groupId>
<artifactId>bwie-modules</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>bwie-user</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- 系统公共 依赖 -->
<dependency>
<groupId>com.bwie</groupId>
<artifactId>bwie-common</artifactId>
</dependency>
<!-- SpringBoot Web-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- Druid -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.2.8</version>
</dependency>
<!-- Mysql Connector -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!-- Mybatis 依赖配置 -->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.2.2</version>
</dependency>
<!-- Pagehelper -->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.4.1</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,16 @@
package com.bwie.user;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* @author gxb
* @description TODO
* @date 2023-12-16 12:18
*/
@SpringBootApplication
public class UserAppliction {
public static void main(String[] args) {
SpringApplication.run(UserAppliction.class,args);
}
}

View File

@ -0,0 +1,66 @@
package com.bwie.user.controller;
import com.bwie.common.domain.Sign;
import com.bwie.common.domain.User;
import com.bwie.common.domain.request.Retri;
import com.bwie.common.result.Result;
import com.bwie.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* @author gxb
* @description TODO
* @date 2023-12-08 20:05
*/
@RestController
public class UserController {
@Autowired
private UserService userService;
/**
*
*/
@PostMapping("/findName")
public Result<User> findName(@RequestParam String username){
return userService.findName(username);
}
/**
*
*/
@PostMapping("/Retrieve")
public Result Retrieve(@RequestBody Retri retri){
return userService.Retrieve(retri);
}
// /**
// * 修改密码
// */
@PostMapping("/updPwd")
public Result updPwd(@RequestParam String userPwd){
return userService.updPwd(userPwd);
}
// /**
// * 注册
// */
@PostMapping("/sign")
public Result sign(@RequestBody Sign sign){
return userService.sign(sign);
}
// /**
// * 管理员管理
// */
@GetMapping("/Role")
public Result Role(){
return userService.Role();
}
// /**
// * 管理员添加
// */
@PostMapping("/Irole")
public Result Irole(@RequestParam Integer num){
if (2==num){
return Result.success(200,"暂未升级管理员");
}
return userService.Irole();
}
}

View File

@ -0,0 +1,36 @@
package com.bwie.user.mapper;
import com.bwie.common.domain.Sign;
import com.bwie.common.domain.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* @author gxb
* @description TODO
* @date 2023-12-08 20:05
*/
@Component
@Mapper
public interface UserMapper {
// User finduserBh(String userBh);
//
User finduserPhone(String userPhone);
//
//
void Inter(Sign sign);
//
//
User findName(String username);
void updPwds(@Param("id") Integer id, @Param("userPwd") String userPwd);
void UpdRoles(Integer id);
List<User> userList(int i);
}

View File

@ -0,0 +1,30 @@
package com.bwie.user.service;
import com.bwie.common.domain.Sign;
import com.bwie.common.domain.User;
import com.bwie.common.domain.request.Retri;
import com.bwie.common.result.Result;
/**
* @author gxb
* @description TODO
* @date 2023-12-08 20:06
*/
public interface UserService {
// Result<User> finduserBh(String userBh);
//找回密码
Result Retrieve(Retri retri);
//修改密码
Result updPwd(String userPwd);
//
Result sign(Sign sign);
//
Result Irole();
//
//
Result Role();
Result<User> findName(String username);
}

View File

@ -0,0 +1,156 @@
package com.bwie.user.service.impl;
import com.alibaba.fastjson.JSON;
import com.bwie.common.constants.TokenConstants;
import com.bwie.common.domain.Sign;
import com.bwie.common.domain.User;
import com.bwie.common.domain.request.Retri;
import com.bwie.common.result.Result;
import com.bwie.common.utils.JwtUtils;
import com.bwie.user.mapper.UserMapper;
import com.bwie.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* @author gxb
* @description TODO
* @date 2023-12-08 20:06
*/
@Service
public class UserServicelmpl implements UserService {
@Autowired
private UserMapper userMapper;
@Autowired
private RedisTemplate<String, String> redisTemplate;
@Autowired
private HttpServletRequest request;
/**
*
* @param username
* @return
*/
@Override
public Result<User> findName(String username) {
User user = userMapper.findName(username);
return Result.success(user);
}
// /**
// * 找回密码
// *
// * @param retri
// * @return
// */
@Override
public Result Retrieve(Retri retri) {
Boolean phone = this.isPhone(retri.getPhone());
if (!phone) {
return Result.error("手机号格式错误");
}
User user = userMapper.finduserPhone(retri.getPhone());
if (null == user) {
return Result.error("手机号不存在,请注册");
}
if (!(retri.getRole() == user.getRole())) {
return Result.error("身份选择错误,请重新选择身份信息");
}
return Result.success("您的密码为:"+user.getPassword(), "找回成功");
}
// /**
// * 修改密码
// *
// * @param userPwd
// * @return
// */
@Override
public Result updPwd(String userPwd) {
Boolean pwd = this.isUserPwd(userPwd);
if (!pwd) {
return Result.error("不超过16位的数字、英文、下划线组成");
}
//获取当前登录人
String token = request.getHeader("token");
String userKey = JwtUtils.getUserKey(token);
String s = redisTemplate.opsForValue().get(TokenConstants.LOGIN_TOKEN_KEY + userKey);
User user = JSON.parseObject(s, User.class);
if (user.getPassword().equals(userPwd)) {
return Result.error("不能使用旧密码,请重新输入");
}
userMapper.updPwds(user.getId(), userPwd);
return Result.success(200, "修改成功");
}
// /**
// * 注册
// *
// * @param sign
// * @return
// */
@Override
public Result sign(Sign sign) {
Boolean phone = this.isPhone(sign.getPhone());
if (!phone) {
return Result.error("手机号格式错误");
}
Boolean userPwd = this.isUserPwd(sign.getPassword());
if (!userPwd) {
return Result.error("密码由不超过16位的数字、英文、下划线组成");
}
User user = userMapper.finduserPhone(sign.getPhone());
if (null != user) {
return Result.error("账号已存在,请前往登录");
}
userMapper.Inter(sign);
return Result.success(200,"注册成功");
}
// /**
// * 添加管理员
// * @return
// */
@Override
public Result Irole() {
String token = request.getHeader("token");
String userKey = JwtUtils.getUserKey(token);
String s = redisTemplate.opsForValue().get(TokenConstants.LOGIN_TOKEN_KEY + userKey);
User user = JSON.parseObject(s, User.class);
if (1==user.getRole()){
return Result.success(200,"您已经是管理员了,无需升级");
}
userMapper.UpdRoles(user.getId());
return Result.success(200,"恭喜您升级成管理员");
}
//
// /**
// * 管理员管理
// * @return
// */
@Override
public Result Role() {
List<User> userList = userMapper.userList(1);
return Result.success(userList,"管理员列表");
}
//密码必填由不超过16位的数字、英文、下划线组成
private Boolean isUserPwd(String userPwd) {
String str = "^[\\w]{1,16}$";
return userPwd.matches(str);
}
//手机号验证
private Boolean isPhone(String userPhone) {
String str = "^1[3-9]\\d{9}$";
return userPhone.matches(str);
}
}

View File

@ -0,0 +1,42 @@
# Tomcat
server:
port: 9009
# Spring
spring:
main:
allow-circular-references: true
jackson:
date-format: yyyy-MM-dd HH:mm:ss
time-zone: GMT+8
application:
# 应用名称
name: bwie-user
profiles:
# 环境配置
active: dev
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: 43.143.161.183:8848
config:
# 配置中心地址
server-addr: 43.143.161.183:8848
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
fdfs:
so-timeout: 1500 # socket 连接时长
connect-timeout: 600 # 连接 tracker 服务器超时时长
# 这两个是你服务器的 IP 地址,注意 23000 端口也要打开阿里云服务器记得配置安全组。tracker 要和 stroage 服务进行交流
tracker-list: 121.40.42.67:22122
web-server-url: 121.40.42.67:8888
pool:
jmx-enabled: false
# 生成缩略图
thumb-image:
height: 500
width: 500

View File

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.bwie.user.mapper.UserMapper">
<sql id="user">
id,username,password,`role`,phone
</sql>
<insert id="Inter">
INSERT INTO `health`.`user`
(`username`, `password`, `role`, `phone`) VALUES
( #{username},#{password} , #{role}, #{phone} );
</insert>
<update id="updPwd">
</update>
<update id="updPwds">
update user set password = #{userPwd} where id = #{id}
</update>
<update id="UpdRoles">
update user set role = 1 where id=#{id}
</update>
<select id="finduserBh" resultType="com.bwie.common.domain.User">
select <include refid="user"></include>
from user where role = #{userBh} ;
</select>
<select id="finduserPhone" resultType="com.bwie.common.domain.User">
select <include refid="user"></include> from user where phone = #{userPhone}
</select>
<select id="findName" resultType="com.bwie.common.domain.User">
select <include refid="user"></include> from user where username = #{username};
</select>
<select id="userList" resultType="com.bwie.common.domain.User">
select <include refid="user"></include>
from user where role = #{i} ;
</select>
</mapper>

View File

@ -12,7 +12,11 @@
<artifactId>bwie-modules</artifactId>
<packaging>pom</packaging>
<modules>
<module>bwie-user</module>
<module>bwie-health</module>
<module>bwie-formation</module>
<module>bwie-cases</module>
<module>bwie-manage</module>
</modules>
<properties>

View File

@ -10,9 +10,9 @@
<packaging>pom</packaging>
<modules>
<module>bwie-common</module>
<module>bwie-auth</module>
<module>bwie-gateway</module>
<module>bwie-modules</module>
<module>bwie-auth</module>
</modules>
<properties>