File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
src/main/java/com/github/binarywang/demo/wx/cp Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 2
2
3
3
import org .redisson .Redisson ;
4
4
import org .redisson .api .RedissonClient ;
5
+ import org .redisson .client .codec .StringCodec ;
5
6
import org .redisson .config .Config ;
6
7
import org .springframework .beans .factory .annotation .Value ;
7
8
import org .springframework .context .annotation .Bean ;
@@ -33,6 +34,8 @@ public RedissonClient redissonClient() throws Exception{
33
34
config .useSingleServer ().setPassword (this .password );
34
35
config .useSingleServer ().setDatabase (this .database );
35
36
37
+ StringCodec codec = new StringCodec ();
38
+ config .setCodec (codec );
36
39
return Redisson .create (config );
37
40
}
38
41
Original file line number Diff line number Diff line change 25
25
@ RequestMapping ("/wx/cp/portal/{corpId}/{agentId}" )
26
26
public class WxPortalController {
27
27
private final Logger logger = LoggerFactory .getLogger (this .getClass ());
28
-
29
28
private final StringRedisTemplate stringRedisTemplate ;
30
29
31
30
@ PostMapping ("/test" )
32
- public String test (@ PathVariable String corpId ) throws WxErrorException {
31
+ public String test (@ PathVariable String corpId ,
32
+ @ RequestParam (name = "userId" , required = true ) String userId ) throws WxErrorException {
33
33
34
34
String s = stringRedisTemplate .opsForValue ().get ("test" );
35
35
logger .info ("data is {}" , s );
36
36
37
37
final val wxCpService = WxCpConfiguration .getCpService (corpId ,10001 );
38
- List <String > list = wxCpService .getExternalContactService ().listExternalContacts ("xxx" );
38
+ List <String > list = wxCpService .getExternalContactService ().listExternalContacts (userId );
39
39
40
40
return list .toString ();
41
41
}
You can’t perform that action at this time.
0 commit comments