|
@ -1,34 +1,12 @@ |
|
|
package com.lh; |
|
|
package com.lh; |
|
|
|
|
|
|
|
|
import com.lh.mapper.CandidatesMapper; |
|
|
|
|
|
import com.lh.mapper.VoterMapper; |
|
|
|
|
|
import com.lh.service.VoteService; |
|
|
|
|
|
import org.junit.jupiter.api.Test; |
|
|
import org.junit.jupiter.api.Test; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
|
import org.springframework.boot.test.context.SpringBootTest; |
|
|
import org.springframework.boot.test.context.SpringBootTest; |
|
|
|
|
|
|
|
|
@SpringBootTest |
|
|
@SpringBootTest |
|
|
class VoteSystemApplicationTests { |
|
|
class VoteSystemApplicationTests { |
|
|
@Autowired |
|
|
|
|
|
private CandidatesMapper candidatesMapper; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private VoterMapper voterMapper; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private VoteService voteService; |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
|
void contextLoads() { |
|
|
void contextLoads() { |
|
|
candidatesMapper.getCandidates().forEach(System.out::println); |
|
|
|
|
|
//System.out.print( voterMapper.countVotesToday("10010")); |
|
|
|
|
|
voteService.getCandidates("90044599").forEach(System.out::println); |
|
|
|
|
|
} |
|
|
} |
|
|
@Test |
|
|
|
|
|
void contextLoads1() { |
|
|
|
|
|
voterMapper.getVotesByCandidate("90044602").forEach(System.out::println); |
|
|
|
|
|
} |
|
|
|
|
|
@Test |
|
|
|
|
|
void contextLoads2() { |
|
|
|
|
|
voterMapper.insertVote("10010","20010","王五"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |