提交 e93be1df 编写于 作者: 夏天。。's avatar 夏天。。

改了部分bug,且优化部分功能

上级 c0aef6b0
...@@ -7,6 +7,7 @@ import com.mobius.modules.ums.dto.CheckDto; ...@@ -7,6 +7,7 @@ import com.mobius.modules.ums.dto.CheckDto;
import com.mobius.modules.ums.model.UmsCheck; import com.mobius.modules.ums.model.UmsCheck;
import com.mobius.modules.ums.service.UmsCheckService; import com.mobius.modules.ums.service.UmsCheckService;
import com.mobius.modules.ums.vo.CheckVo; import com.mobius.modules.ums.vo.CheckVo;
import com.mobius.utils.DateUtils;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -45,11 +46,10 @@ public class UmsCheckController { ...@@ -45,11 +46,10 @@ public class UmsCheckController {
return checkService.checkListByMonth(date); return checkService.checkListByMonth(date);
} }
@GetMapping("/day") @GetMapping("")
@ApiOperation(value = "获取今日签到信息") @ApiOperation(value = "获取某日签到信息")
public CommonResult getDailyCheck(){ public CommonResult getDailyCheck(Date date){
CheckDto dailyCheck = checkService.getDailyCheck(); return checkService.getCheckRewardsByDate(DateUtils.getZeroTime(date));
return CommonResult.success(dailyCheck);
} }
@PutMapping("") @PutMapping("")
......
...@@ -37,4 +37,6 @@ public interface UmsCheckService extends IService<UmsCheck> { ...@@ -37,4 +37,6 @@ public interface UmsCheckService extends IService<UmsCheck> {
CheckDto getCheckDto(UmsCheck check); CheckDto getCheckDto(UmsCheck check);
CommonResult getCheckRewardsByDate(Date date);
} }
...@@ -139,4 +139,10 @@ public class UmsCheckServiceImpl extends ServiceImpl<UmsCheckMapper, UmsCheck> i ...@@ -139,4 +139,10 @@ public class UmsCheckServiceImpl extends ServiceImpl<UmsCheckMapper, UmsCheck> i
} }
@Override
public CommonResult getCheckRewardsByDate(Date date) {
UmsCheck checkByValidDate = getCheckByValidDate(date);
return CommonResult.success(checkByValidDate.getRewards());
}
} }
...@@ -9,10 +9,7 @@ import lombok.EqualsAndHashCode; ...@@ -9,10 +9,7 @@ import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length; import org.hibernate.validator.constraints.Length;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import javax.validation.constraints.NotEmpty; import javax.validation.constraints.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.util.Date; import java.util.Date;
/** /**
...@@ -30,7 +27,8 @@ public class RewardVo { ...@@ -30,7 +27,8 @@ public class RewardVo {
@NotNull(message = "奖励类型不能为空") @NotNull(message = "奖励类型不能为空")
@ApiModelProperty("奖励类型 0积分 1邮票") @ApiModelProperty("奖励类型 0积分 1邮票")
@Pattern(regexp = "[1|0]") @Max(value = 1,message = "奖励类型只能是0或者1")
@Min(value = 0,message = "奖励类型只能是0或者1")
private Integer type; private Integer type;
@NotEmpty(message = "奖励描述不能为空") @NotEmpty(message = "奖励描述不能为空")
......
...@@ -27,6 +27,12 @@ ...@@ -27,6 +27,12 @@
<version>1.1.8</version> <version>1.1.8</version>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>
<!--Bean Validation--> <!--Bean Validation-->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
......
...@@ -43,4 +43,7 @@ public class PenBriefDTO { ...@@ -43,4 +43,7 @@ public class PenBriefDTO {
@ApiModelProperty(value = "是否读") @ApiModelProperty(value = "是否读")
private Integer isRead; private Integer isRead;
@ApiModelProperty(value = "发信人昵称")
private String nickName;
} }
...@@ -45,5 +45,8 @@ public class PenInfoDTO { ...@@ -45,5 +45,8 @@ public class PenInfoDTO {
@ApiModelProperty(value = "延迟时间,以小时作为单位") @ApiModelProperty(value = "延迟时间,以小时作为单位")
private Integer delayTime; private Integer delayTime;
@ApiModelProperty(value = "发信人昵称")
private String nickName;
} }
...@@ -23,13 +23,13 @@ import java.util.Date; ...@@ -23,13 +23,13 @@ import java.util.Date;
public interface LmsPenMapper extends BaseMapper<LmsPen> { public interface LmsPenMapper extends BaseMapper<LmsPen> {
@Select("select * from lms_pen where sender_id = #{senderId} and is_delete = 0 order by is_read asc,id desc") @Select("select * from ums_user,lms_pen where sender_id = #{senderId} and is_delete = 0 and ums_user.id = lms_pen.sender_id order by is_read asc,id desc")
IPage<PenBriefDTO> selectSenderPenBriefList(Long senderId, IPage<PenBriefDTO> page); IPage<PenBriefDTO> selectSenderPenBriefList(Long senderId, IPage<PenBriefDTO> page);
@Select("select * from lms_pen where sender_id = #{senderId} and receiver_Id = #{receiverId} and arrive_time > #{arriveTime} and is_delete = 0 order by is_read asc,arrive_time desc") @Select("select * from ums_user,lms_pen where sender_id = #{senderId} and receiver_Id = #{receiverId} and arrive_time > #{arriveTime} and is_delete = 0 and ums_user.id = lms_pen.sender_id order by is_read asc,arrive_time desc")
IPage<PenBriefDTO> selectSenderPenBriefList(@Param("senderId") Long senderId, @Param("receiverId") Long receiverId, @Param("arriveTime") Date arriveTime,IPage<PenBriefDTO> page); IPage<PenBriefDTO> selectSenderPenBriefList(@Param("senderId") Long senderId, @Param("receiverId") Long receiverId, @Param("arriveTime") Date arriveTime,IPage<PenBriefDTO> page);
@Select("select * from lms_pen,lms_incident,lms_letter_content where lms_pen.id = #{id} and lms_pen.incident_id = lms_incident.id and lms_pen.content_id = lms_letter_content.id") @Select("select * from ums_user,lms_pen,lms_incident,lms_letter_content where lms_pen.id = #{id} and lms_pen.incident_id = lms_incident.id and lms_pen.content_id = lms_letter_content.id and ums_user.id = lms_pen.sender_id")
PenInfoDTO selectPenInfo(Long id); PenInfoDTO selectPenInfo(Long id);
} }
...@@ -39,7 +39,7 @@ public class UmsCheckController { ...@@ -39,7 +39,7 @@ public class UmsCheckController {
@ApiOperation("签到") @ApiOperation("签到")
@GetMapping("") @GetMapping("")
public CommonResult userCheck(){ public CommonResult userCheck(){
return CommonResult.success(ResultCode.SUCCESS); return checkService.userCheck();
} }
} }
package com.mobius.modules.ums.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 前端控制器
* </p>
*
* @author Sqh
* @since 2022-06-17
*/
@RestController
@RequestMapping("/ums/umsUserCheckRecord")
public class UmsUserCheckRecordController {
}
package com.mobius.modules.ums.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mobius.modules.ums.model.UmsUserCheckRecord;
/**
* <p>
* Mapper 接口
* </p>
*
* @author Sqh
* @since 2022-06-17
*/
public interface UmsUserCheckRecordMapper extends BaseMapper<UmsUserCheckRecord> {
}
package com.mobius.modules.ums.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author Sqh
* @since 2022-06-17
*/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("ums_user_check_record")
@ApiModel(value="UmsUserCheckRecord对象", description="")
@AllArgsConstructor
@NoArgsConstructor
public class UmsUserCheckRecord implements Serializable {
private static final long serialVersionUID=1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "签到用户id")
private Integer userId;
@ApiModelProperty(value = "记录时间")
private Date createDate;
@ApiModelProperty(value = "奖励id")
private Integer checkId;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
}
...@@ -4,9 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType; ...@@ -4,9 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import lombok.Builder; import lombok.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
...@@ -23,6 +21,8 @@ import java.util.Date; ...@@ -23,6 +21,8 @@ import java.util.Date;
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@TableName("ums_user_stamp_relation") @TableName("ums_user_stamp_relation")
@ApiModel(value="UmsUserStampRelation对象", description="") @ApiModel(value="UmsUserStampRelation对象", description="")
@AllArgsConstructor
@NoArgsConstructor
public class UmsUserStampRelation implements Serializable { public class UmsUserStampRelation implements Serializable {
private static final long serialVersionUID=1L; private static final long serialVersionUID=1L;
......
...@@ -27,4 +27,6 @@ public interface UmsCheckService extends IService<UmsCheck> { ...@@ -27,4 +27,6 @@ public interface UmsCheckService extends IService<UmsCheck> {
CheckDto getDailyCheck(); CheckDto getDailyCheck();
CheckDto getCheckDto(UmsCheck check); CheckDto getCheckDto(UmsCheck check);
} }
package com.mobius.modules.ums.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mobius.modules.ums.model.UmsUserCheckRecord;
/**
* <p>
* 服务类
* </p>
*
* @author Sqh
* @since 2022-06-17
*/
public interface UmsUserCheckRecordService extends IService<UmsUserCheckRecord> {
UmsUserCheckRecord getUserCheckRecord(Integer userId, Integer checkId);
}
package com.mobius.modules.ums.service.impl; package com.mobius.modules.ums.service.impl;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mobius.common.api.CommonResult; import com.mobius.common.api.CommonResult;
...@@ -9,10 +11,10 @@ import com.mobius.common.service.RedisService; ...@@ -9,10 +11,10 @@ import com.mobius.common.service.RedisService;
import com.mobius.common.util.DateUtils; import com.mobius.common.util.DateUtils;
import com.mobius.modules.ums.dto.CheckDto; import com.mobius.modules.ums.dto.CheckDto;
import com.mobius.modules.ums.mapper.UmsCheckMapper; import com.mobius.modules.ums.mapper.UmsCheckMapper;
import com.mobius.modules.ums.model.UmsCheck; import com.mobius.modules.ums.mapper.UmsUserCheckRecordMapper;
import com.mobius.modules.ums.model.UmsReward; import com.mobius.modules.ums.model.*;
import com.mobius.modules.ums.service.UmsCheckService; import com.mobius.modules.ums.service.*;
import com.mobius.modules.ums.service.UmsRewardService; import io.swagger.annotations.ApiModelProperty;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -40,6 +42,12 @@ public class UmsCheckServiceImpl extends ServiceImpl<UmsCheckMapper, UmsCheck> i ...@@ -40,6 +42,12 @@ public class UmsCheckServiceImpl extends ServiceImpl<UmsCheckMapper, UmsCheck> i
private RedisService redisService; private RedisService redisService;
@Autowired @Autowired
private UmsRewardService rewardService; private UmsRewardService rewardService;
@Autowired
private UmsUserCheckRecordService recordService;
@Autowired
private UmsUserService userService;
@Autowired
private UmsUserStampRelationService relationService;
...@@ -51,10 +59,19 @@ public class UmsCheckServiceImpl extends ServiceImpl<UmsCheckMapper, UmsCheck> i ...@@ -51,10 +59,19 @@ public class UmsCheckServiceImpl extends ServiceImpl<UmsCheckMapper, UmsCheck> i
@Override @Override
public CommonResult userCheck() { public CommonResult userCheck() {
UmsUser currentUser = userService.getCurrentUser();
CheckDto dailyCheck = getDailyCheck(); CheckDto dailyCheck = getDailyCheck();
if (dailyCheck!=null){ if (dailyCheck==null){
return CommonResult.success("今日无签到");
} }
UmsUserCheckRecord userCheckRecord = recordService.getUserCheckRecord(currentUser.getId(), dailyCheck.getId());
if (userCheckRecord!=null){
return CommonResult.failed("今日已经签到过了");
}
getCheckReward(dailyCheck.getRewards(),currentUser);
recordService.save(new UmsUserCheckRecord(0,currentUser.getId(),new Date(),dailyCheck.getId(),new Date()));
return CommonResult.success(ResultCode.SUCCESS); return CommonResult.success(ResultCode.SUCCESS);
} }
...@@ -96,4 +113,24 @@ public class UmsCheckServiceImpl extends ServiceImpl<UmsCheckMapper, UmsCheck> i ...@@ -96,4 +113,24 @@ public class UmsCheckServiceImpl extends ServiceImpl<UmsCheckMapper, UmsCheck> i
return new CheckDto(check.getId(),check.getValidTime(),rewards); return new CheckDto(check.getId(),check.getValidTime(),rewards);
} }
void getCheckReward(List<UmsReward> rewards, UmsUser user){
List<UmsUserStampRelation> relations = new ArrayList<>();
Integer value = 0;
for (UmsReward reward: rewards){
if (reward.getType()==0){
value+=reward.getValue();
}else if(reward.getType()==1) {
relations.add(new UmsUserStampRelation(0L,user.getId(),1L,new Date(),new Date()));
}
}
user.setGrowValue(user.getGrowValue()+value);
userService.updateUserById(user);
for(UmsUserStampRelation relation:relations) {
relationService.save(relation);
}
}
} }
package com.mobius.modules.ums.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mobius.modules.ums.mapper.UmsUserCheckRecordMapper;
import com.mobius.modules.ums.model.UmsUserCheckRecord;
import com.mobius.modules.ums.service.UmsUserCheckRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author Sqh
* @since 2022-06-17
*/
@Service
public class UmsUserCheckRecordServiceImpl extends ServiceImpl<UmsUserCheckRecordMapper, UmsUserCheckRecord> implements UmsUserCheckRecordService {
@Autowired
private UmsUserCheckRecordMapper recordMapper;
@Override
public UmsUserCheckRecord getUserCheckRecord(Integer userId, Integer checkId) {
QueryWrapper<UmsUserCheckRecord> wrapper = new QueryWrapper<>();
wrapper.eq("user_id",userId);
wrapper.eq("check_id",checkId);
return recordMapper.selectOne(wrapper);
}
}
...@@ -7,6 +7,8 @@ spring: ...@@ -7,6 +7,8 @@ spring:
profiles: profiles:
active: dev active: dev
cache:
type: redis
mybatis-plus: mybatis-plus:
mapper-locations: classpath:/mapper/**/*.xml mapper-locations: classpath:/mapper/**/*.xml
global-config: global-config:
......
package com.mobius.modules.lms.mapper; //package com.mobius.modules.lms.mapper;
//
import com.baomidou.mybatisplus.core.metadata.IPage; //import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; //import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mobius.modules.lms.dto.PenBriefDTO; //import com.mobius.modules.lms.dto.PenBriefDTO;
import com.mobius.modules.lms.dto.PenInfoDTO; //import com.mobius.modules.lms.dto.PenInfoDTO;
import org.junit.jupiter.api.Test; //import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest; //import org.springframework.boot.test.context.SpringBootTest;
//
/** ///**
* @Author: hocztms // * @Author: hocztms
* @Description: // * @Description:
* @Date Created in 2022-05-13-0:37 // * @Date Created in 2022-05-13-0:37
* @Modified By: // * @Modified By:
*/ // */
@SpringBootTest //@SpringBootTest
class LmsPenMapperTest { //class LmsPenMapperTest {
//
@Autowired // @Autowired
private LmsPenMapper lmsPenMapper; // private LmsPenMapper lmsPenMapper;
//
@Test // @Test
public void test(){ // public void test(){
IPage<PenBriefDTO> senderPenBriefList = lmsPenMapper.selectSenderPenBriefList(3L, new Page<>(1, 3)); // IPage<PenBriefDTO> senderPenBriefList = lmsPenMapper.selectSenderPenBriefList(3L, new Page<>(1, 3));
System.out.println(senderPenBriefList.getRecords().toString()); // System.out.println(senderPenBriefList.getRecords().toString());
PenInfoDTO penInfoDTO = lmsPenMapper.selectPenInfo(2L); // PenInfoDTO penInfoDTO = lmsPenMapper.selectPenInfo(2L);
System.out.println(penInfoDTO.toString()); // System.out.println(penInfoDTO.toString());
} // }
//
} //}
\ No newline at end of file \ No newline at end of file
package com.mobius.modules.lms.service.impl; //package com.mobius.modules.lms.service.impl;
//
import com.mobius.modules.lms.service.LmsVerifyLetterService; //import com.mobius.modules.lms.service.LmsVerifyLetterService;
import org.junit.jupiter.api.Test; //import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest; //import org.springframework.boot.test.context.SpringBootTest;
//
import static org.junit.jupiter.api.Assertions.*; //import static org.junit.jupiter.api.Assertions.*;
//
/** ///**
* @author Sqh // * @author Sqh
* @date 2022/5/12 // * @date 2022/5/12
*/ // */
@SpringBootTest //@SpringBootTest
class LmsVerifyLetterServiceImplTest { //class LmsVerifyLetterServiceImplTest {
@Autowired // @Autowired
private LmsVerifyLetterService verifyLetterService; // private LmsVerifyLetterService verifyLetterService;
//
@Test // @Test
void verifyLetterContent() { // void verifyLetterContent() {
String testContent = "ausdhauhduahsdas"; // String testContent = "ausdhauhduahsdas";
verifyLetterService.verifyLetterContent(testContent); // verifyLetterService.verifyLetterContent(testContent);
} // }
} //}
\ No newline at end of file \ No newline at end of file
package com.mobius.modules.ums.mapper; //package com.mobius.modules.ums.mapper;
//
import com.baomidou.mybatisplus.core.metadata.IPage; // import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; // import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mobius.modules.ums.dto.UserListDto; // import com.mobius.modules.ums.dto.UserListDto;
import org.junit.jupiter.api.Test; // import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; // import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest; // import org.springframework.boot.test.context.SpringBootTest;
//
import static org.junit.jupiter.api.Assertions.*; // import static org.junit.jupiter.api.Assertions.*;
//
/** ///**
* @Author: hocztms // * @Author: hocztms
* @Description: // * @Description:
* @Date Created in 2022-06-07-21:57 // * @Date Created in 2022-06-07-21:57
* @Modified By: // * @Modified By:
*/ // */
@SpringBootTest //@SpringBootTest
class UmsUserMapperTest { //class UmsUserMapperTest {
//
@Autowired // @Autowired
private UmsUserMapper userMapper; // private UmsUserMapper userMapper;
@Test // @Test
void selectUserListByNickName() { // void selectUserListByNickName() {
IPage<UserListDto> h = userMapper.selectUserListByNickName("h", new Page<>(1, 5)); // IPage<UserListDto> h = userMapper.selectUserListByNickName("h", new Page<>(1, 5));
System.out.println(h.getRecords().toString()); // System.out.println(h.getRecords().toString());
} // }
} //}
\ No newline at end of file \ No newline at end of file
package com.mobius.modules.ums.service.impl; //package com.mobius.modules.ums.service.impl;
//
import com.mobius.modules.lms.service.LmsVerifyLetterService; //import com.mobius.modules.lms.service.LmsVerifyLetterService;
import org.junit.jupiter.api.Test; //import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.beans.factory.annotation.Autowired;
//
import java.util.regex.Matcher; //import java.util.regex.Matcher;
import java.util.regex.Pattern; //import java.util.regex.Pattern;
//
import static org.junit.jupiter.api.Assertions.*; //import static org.junit.jupiter.api.Assertions.*;
//
/** ///**
* @author Sqh // * @author Sqh
* @date 2022/6/13 // * @date 2022/6/13
*/ // */
class UserInfoServiceImplTest { //class UserInfoServiceImplTest {
//
public static final Pattern timeRegex= Pattern.compile("^([0-1][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$"); // public static final Pattern timeRegex= Pattern.compile("^([0-1][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$");
//
@Test // @Test
void verifyLetterContent() { // void verifyLetterContent() {
String str = "25:15:00"; // String str = "25:15:00";
Matcher matcher = timeRegex.matcher(str); // Matcher matcher = timeRegex.matcher(str);
System.out.println(matcher.find()); // System.out.println(matcher.find());
//
str = "23:15:00"; // str = "23:15:00";
matcher = timeRegex.matcher(str); // matcher = timeRegex.matcher(str);
System.out.println(matcher.find()); // System.out.println(matcher.find());
//
str = "00:15:00"; // str = "00:15:00";
matcher = timeRegex.matcher(str); // matcher = timeRegex.matcher(str);
System.out.println(matcher.find()); // System.out.println(matcher.find());
//
str = "02:15:00"; // str = "02:15:00";
matcher = timeRegex.matcher(str); // matcher = timeRegex.matcher(str);
System.out.println(matcher.find()); // System.out.println(matcher.find());
//
str = "2:15:00"; // str = "2:15:00";
matcher = timeRegex.matcher(str); // matcher = timeRegex.matcher(str);
System.out.println(matcher.find()); // System.out.println(matcher.find());
//
} // }
//
} //}
\ No newline at end of file \ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册