| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -838,9 +838,4 @@ public static boolean isImage(String imageName) { | |||
| 838 | 838 | || "png".equals(fileType) || "PNG".equals(fileType)); | |
| 839 | 839 | } | |
| 840 | 840 | ||
| 841 | - public static void main(String args[]) throws Exception { | ||
| 842 | - System.out.println(TimeUtil.getDateNow(TimeUtil.DATE_FORMAT_STRING)); | ||
| 843 | - System.out.println(getType("E:\\oscchina\\xiaomoBlogJava\\core\\src\\main\\java\\info\\xiaomo\\core\\constant\\GenderConst.java")); | ||
| 844 | - } | ||
| 845 | - | ||
| 846 | 841 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -799,7 +799,7 @@ public static String null2SZero(String str) { | |||
| 799 | 799 | * @return | |
| 800 | 800 | */ | |
| 801 | 801 | public static String stringToUnicode(String text) { | |
| 802 | - String result = ""; | ||
| 802 | + StringBuffer result = new StringBuffer(); | ||
| 803 | 803 | int input; | |
| 804 | 804 | StringReader isr; | |
| 805 | 805 | try { | |
@@ -809,14 +809,14 @@ public static String stringToUnicode(String text) { | |||
| 809 | 809 | } | |
| 810 | 810 | try { | |
| 811 | 811 | while ((input = isr.read()) != -1) { | |
| 812 | - result = result + "&#x" + Integer.toHexString(input) + ";"; | ||
| 812 | + result.append("&#x").append(input).append(";"); | ||
| 813 | 813 | ||
| 814 | 814 | } | |
| 815 | 815 | } catch (IOException e) { | |
| 816 | 816 | return "-2"; | |
| 817 | 817 | } | |
| 818 | 818 | isr.close(); | |
| 819 | - return result; | ||
| 819 | + return result.toString(); | ||
| 820 | 820 | ||
| 821 | 821 | } | |
| 822 | 822 | ||
@@ -828,23 +828,21 @@ public static String gb2utf(String inStr) { | |||
| 828 | 828 | char temChr; | |
| 829 | 829 | int ascInt; | |
| 830 | 830 | int i; | |
| 831 | - String result = ""; | ||
| 831 | + StringBuilder stringBuffer = new StringBuilder(); | ||
| 832 | 832 | if (inStr == null) { | |
| 833 | 833 | inStr = ""; | |
| 834 | 834 | } | |
| 835 | 835 | for (i = 0; i < inStr.length(); i++) { | |
| 836 | 836 | temChr = inStr.charAt(i); | |
| 837 | 837 | ascInt = temChr; | |
| 838 | - //System.out.println("1=="+ascInt); | ||
| 839 | - //System.out.println("1=="+Integer.toBinaryString(ascInt)); | ||
| 840 | 838 | if (Integer.toHexString(ascInt).length() > 2) { | |
| 841 | - result = result + "&#x" + Integer.toHexString(ascInt) + ";"; | ||
| 839 | + stringBuffer.append("&#x").append(Integer.toHexString(ascInt)).append(";"); | ||
| 842 | 840 | } else { | |
| 843 | - result = result + temChr; | ||
| 841 | + stringBuffer.append(temChr); | ||
| 844 | 842 | } | |
| 845 | 843 | ||
| 846 | 844 | } | |
| 847 | - return result; | ||
| 845 | + return stringBuffer.toString(); | ||
| 848 | 846 | } | |
| 849 | 847 | ||
| 850 | 848 | /** | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -502,8 +502,6 @@ public static String getDateFromNow(int afterDay, String pattern) { | |||
| 502 | 502 | */ | |
| 503 | 503 | public static String getNowForFileName(int afterDay) { | |
| 504 | 504 | GregorianCalendar calendar = new GregorianCalendar(); | |
| 505 | - // Date DATE = calendar.getTime(); | ||
| 506 | - | ||
| 507 | 505 | SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmmss"); | |
| 508 | 506 | ||
| 509 | 507 | calendar.set(Calendar.DATE, calendar.get(Calendar.DATE) + afterDay); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,4 @@ | |||
| 1 | - package info.xiaomo.multipleSource; | ||
| 1 | + package info.xiaomo.multiplesource; | ||
| 2 | 2 | ||
| 3 | 3 | import org.springframework.beans.factory.annotation.Qualifier; | |
| 4 | 4 | import org.springframework.boot.SpringApplication; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,7 @@ | |||
| 1 | - package info.xiaomo.multipleSource.controller; | ||
| 1 | + package info.xiaomo.multiplesource.controller; | ||
| 2 | 2 | ||
| 3 | 3 | import info.xiaomo.core.base.Result; | |
| 4 | - import info.xiaomo.multipleSource.sql.Sql; | ||
| 4 | + import info.xiaomo.multiplesource.sql.Sql; | ||
| 5 | 5 | import org.springframework.beans.factory.annotation.Autowired; | |
| 6 | 6 | import org.springframework.beans.factory.annotation.Qualifier; | |
| 7 | 7 | import org.springframework.jdbc.core.JdbcTemplate; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,4 @@ | |||
| 1 | - package info.xiaomo.multipleSource.domain; | ||
| 1 | + package info.xiaomo.multiplesource.domain; | ||
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | 4 | import lombok.Data; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,4 @@ | |||
| 1 | - package info.xiaomo.multipleSource.sql; | ||
| 1 | + package info.xiaomo.multiplesource.sql; | ||
| 2 | 2 | ||
| 3 | 3 | /** | |
| 4 | 4 | * 把今天最好的表现当作明天最新的起点..~ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,16 +20,24 @@ public interface UserMapper { | |||
| 20 | 20 | ||
| 21 | 21 | /** | |
| 22 | 22 | * 根据名字查 | |
| 23 | + * @param name | ||
| 24 | + * @return user | ||
| 23 | 25 | */ | |
| 24 | 26 | @Select("SELECT * FROM USER WHERE NAME = #{name}") | |
| 25 | 27 | User findByName(@Param("name") String name); | |
| 26 | 28 | ||
| 29 | + /** | ||
| 30 | + * 插入 | ||
| 31 | + * | ||
| 32 | + * @param name | ||
| 33 | + * @param age | ||
| 34 | + * @return | ||
| 35 | + */ | ||
| 27 | 36 | @Insert("INSERT INTO USER(NAME, AGE) VALUES(#{name}, #{age})") | |
| 28 | 37 | int insert(@Param("name") String name, @Param("age") Integer age); | |
| 29 | 38 | ||
| 30 | 39 | /** | |
| 31 | 40 | * 查所有 | |
| 32 | - * | ||
| 33 | 41 | * @return | |
| 34 | 42 | */ | |
| 35 | 43 | @Select("SELECT * FROM USER WHERE 1=1") | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -176,24 +176,6 @@ public Result findById(@PathVariable Long id) { | |||
| 176 | 176 | return null; | |
| 177 | 177 | } | |
| 178 | 178 | ||
| 179 | - | ||
| 180 | - // /** | ||
| 181 | - // * 返回所有 带分页 | ||
| 182 | - // * | ||
| 183 | - // * @param start start | ||
| 184 | - // * @param pageSize pageSize | ||
| 185 | - // * @return 分页数据 | ||
| 186 | - // */ | ||
| 187 | - // @RequestMapping("findAll") | ||
| 188 | - // public Result findAll(@RequestParam(value = "start", defaultValue = "1") int start, @RequestParam(value = "pageSize", defaultValue = "10") int pageSize) { | ||
| 189 | - // Page<LinkModel> pages = service.findAll(start, pageSize); | ||
| 190 | - // if (pages == null || pages.getSize() <= 0) { | ||
| 191 | - // return new Result<>(CodeConst.NULL_DATA.getResultCode(), CodeConst.NULL_DATA.getMessage()); | ||
| 192 | - // } | ||
| 193 | - // return new Result<>(pages); | ||
| 194 | - // } | ||
| 195 | - | ||
| 196 | - | ||
| 197 | 179 | /** | |
| 198 | 180 | * 添加链接 | |
| 199 | 181 | * | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,13 +21,19 @@ | |||
| 21 | 21 | * @author : xiaomo | |
| 22 | 22 | * github: https://github.com/xiaomoinfo | |
| 23 | 23 | * email: xiaomo@xiaomo.info | |
| 24 | - | ||
| 24 | + * <p> | ||
| 25 | 25 | * Date: 16/4/2 13:08 | |
| 26 | 26 | * Copyright(©) 2015 by xiaomo. | |
| 27 | 27 | */ | |
| 28 | 28 | @Repository | |
| 29 | 29 | public interface AdminUserDao extends JpaRepository<AdminModel, Long> { | |
| 30 | 30 | ||
| 31 | + /** | ||
| 32 | + * 根据名字查用户 | ||
| 33 | + * | ||
| 34 | + * @param s | ||
| 35 | + * @return | ||
| 36 | + */ | ||
| 31 | 37 | AdminModel findAdminUserByUserName(String s); | |
| 32 | 38 | ||
| 33 | 39 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments