我在我的magento项目中安装了GitHub主题的样板,看起来非常好,像我的帐户和检查部分这样的区域非常专业,但我更喜欢rwd项目的一些小功能.

现在我试图从rwd主题获得正确的顶部

这就是我期待看到我的新magento项目的方式

我是如何在不失去功能的情况下从样板主题更改右上角(帐户和购物车)的?
我想分享一个项目,目前可以创建用户,每个用户可以创建N个帖子
源码在github上
和模板层
目前,每个帖子的提要都有一个按钮,可以发送评论帖子我想更改它以放置帖子的评论而不是发送和发送电子邮件每个用户应该能够评论帖子并且评论应该保留
{% block container %}
<body id="bg" img style="zoom: 85%; background-position: center center; background-attachment: fixed;background-repeat:no-repeat;padding:5px; background-image: url('{% static "/back.png"%}') ";>
<div style="background-image: url({% static 'static/img/back.png' %});">
<div class="row" style="align:center">
{% for post in posts %}
<div class="col-sm-12 col-md-8 offset-md-4 mt-5 p-0 post-container,width:50%;">
<div class="card" style="width: 32rem;width:50%;">
<div class="card-body">
<div class="media pt-3 pl-3 pb-1">
<a href="{% url " users:detail" post.user.username%}">
<img alt="{{ post.user.username }}" class="mr-3 rounded-circle" height="35"
src="{{ post.profile.picture.url }}">
</a>
<h3 class="card-title">{{ post.title }}</h3>
</div> …Run Code Online (Sandbox Code Playgroud) 我正在尝试测试具有@getmapping一个参数和 PageableDefault的休息服务
@GetMapping(path = "/api/{serial}/gender")
public ResponseEntity<?> task(
@PathVariable(value = "serial") String Serial,
@PageableDefault(size = 5, value = 0) Pageable pageable) {
return ResponseEntity.ok(page);
}
Run Code Online (Sandbox Code Playgroud)
带有 mockmvc 的测试套件
@Test
public void testTask() throws Exception {
String url ="/api/123456789/gender";
MvcResult mvcResult = mockMvc.perform(MockMvcRequestBuilders.get(url))
.andExpect(MockMvcResultMatchers.status().isOk()).andReturn();
}
Run Code Online (Sandbox Code Playgroud)
我收到以下错误,我无法注入 Pageable 因为它是一个接口,我如何模拟 @pageable 默认值?
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.IllegalStateException: No primary or default constructor found for interface org.springframework.data.domain.Pageable
我完全相信我的问题很简单,但我无法用流来做(如果有没有流的方法也会有帮助)假设我们有这个用户列表
public class Users {
String firstName;
String lastName;
double accountBalance;
String type;
String extraField;
}
Run Code Online (Sandbox Code Playgroud)
并假设我们的 List < Users > 中有以下数据
"Users": [{
"firstName": "Scott",
"lastName": "Salisbury",
"accountBalance": "100",
"type" : "A"
}, {
"firstName": "John",
"lastName": "Richards",
"accountBalance": "200",
"type" :"C"
}, {
"firstName": "John",
"lastName": "Richards",
"accountBalance": "200",
"type " : "C",
"ExtraField": "Apply"
}]
Run Code Online (Sandbox Code Playgroud)
这里的预期结果是因为 firstName、lastName 和 type 在列表中出现两次,只需合并常见的结果,而不会丢失任何字段
预期输出
"Users": [{
"firstName": "Scott",
"lastName": "Salisbury",
"accountBalance": "100",
"type" : "A"
}, {
"firstName": "John",
"lastName": …Run Code Online (Sandbox Code Playgroud) boilerplate ×1
django ×1
django-forms ×1
java ×1
java-stream ×1
magento-1.9 ×1
mockmvc ×1
python ×1
rest ×1
spring ×1